class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: F = None
        self.v: B = None
        self.p: B = None
        self.w: E = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: B = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: C = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: B = None
        self.txt = txt

e = A("e")
b = B("b")
i = C("i")
f = D("f")
k = E("k")
d = F("d")

e.x = b
e.v = b
e.p = b
e.u = d
e.w = k
e.o = k
b.z = i
i.t = k
i.u = b
i.z = e
f.z = b
f.s = i
f.w = e
k.r = b
d.r = k
d.x = b
assert k.r.z.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: F = None
        self.v: B = None
        self.p: B = None
        self.w: E = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: B = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: C = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: B = None
        self.txt = txt

e = A("e")
b = B("b")
i = C("i")
f = D("f")
k = E("k")
d = F("d")

e.x = b
e.v = b
e.p = b
e.u = d
e.w = k
e.o = k
b.z = i
i.t = k
i.u = b
i.z = e
f.z = b
f.s = i
f.w = e
k.r = b
d.r = k
d.x = b
assert k.r.z.u.z.txt == "i"