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

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: C = None
        self.v: E = None
        self.q: D = None
        self.z: B = None
        self.txt = txt

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

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

b = A("b")
f = B("f")
k = C("k")
n = D("n")
a = E("a")
e = E("e")
l = D("l")
c = C("c")

b.z = n
f.y = a
k.t = c
k.w = c
k.v = e
k.q = n
k.z = f
n.z = b
n.o = k
a.t = n
a.o = e
a.y = k
a.x = b
e.t = n
e.o = a
e.y = k
e.x = b
l.z = b
l.o = k
c.t = k
c.w = k
c.v = a
c.q = n
c.z = f
assert k.z.y.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: C = None
        self.v: E = None
        self.q: D = None
        self.z: B = None
        self.txt = txt

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

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

b = A("b")
f = B("f")
k = C("k")
n = D("n")
a = E("a")
e = E("e")
l = D("l")
c = C("c")

b.z = n
f.y = a
k.t = c
k.w = c
k.v = e
k.q = n
k.z = f
n.z = b
n.o = k
a.t = n
a.o = e
a.y = k
a.x = b
e.t = n
e.o = a
e.y = k
e.x = b
l.z = b
l.o = k
c.t = k
c.w = k
c.v = a
c.q = n
c.z = f
assert k.z.y.x.z.txt == "n"