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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: A = None
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

b = A("b")
m = B("m")
d = C("d")
c = D("c")
k = E("k")

b.z = k
b.t = d
b.o = d
b.s = m
b.q = m
m.y = d
m.q = d
m.s = b
d.o = b
d.s = c
c.x = d
k.q = c
k.x = d
k.o = d
k.t = b
k.y = m
assert k.t.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: C = None
        self.s: B = None
        self.q: B = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: A = None
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

b = A("b")
m = B("m")
d = C("d")
c = D("c")
k = E("k")

b.z = k
b.t = d
b.o = d
b.s = m
b.q = m
m.y = d
m.q = d
m.s = b
d.o = b
d.s = c
c.x = d
k.q = c
k.x = d
k.o = d
k.t = b
k.y = m
assert k.t.z.y.txt == "m"