class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: B = None
        self.p: D = None
        self.t: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: D = None
        self.r: C = None
        self.q: D = None
        self.z: B = None
        self.txt = txt

j = A("j")
m = B("m")
c = C("c")
n = D("n")
f = E("f")
e = E("e")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: D = None
        self.r: C = None
        self.q: D = None
        self.z: B = None
        self.txt = txt

j = A("j")
m = B("m")
c = C("c")
n = D("n")
f = E("f")
e = E("e")

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