class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: F = None
        self.p: C = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: B = None
        self.w: B = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: B = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

b = A("b")
i = B("i")
j = C("j")
n = D("n")
k = E("k")
e = F("e")

b.v = j
b.p = j
b.z = j
b.u = e
i.t = n
j.y = k
j.r = i
j.w = i
j.z = n
n.o = i
n.x = b
k.p = j
k.o = i
k.q = i
e.q = b
assert b.u.q.u.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: F = None
        self.p: C = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: B = None
        self.w: B = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: B = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

b = A("b")
i = B("i")
j = C("j")
n = D("n")
k = E("k")
e = F("e")

b.v = j
b.p = j
b.z = j
b.u = e
i.t = n
j.y = k
j.r = i
j.w = i
j.z = n
n.o = i
n.x = b
k.p = j
k.o = i
k.q = i
e.q = b
assert b.u.q.u.q.z.txt == "j"