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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: B = None
        self.t: E = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

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

f = A("f")
c = B("c")
k = C("k")
d = D("d")
b = E("b")
e = A("e")
n = E("n")
j = E("j")

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: B = None
        self.t: E = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

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

f = A("f")
c = B("c")
k = C("k")
d = D("d")
b = E("b")
e = A("e")
n = E("n")
j = E("j")

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