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

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

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

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

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

k = A("k")
l = B("l")
j = C("j")
e = D("e")
b = E("b")

k.y = b
k.t = j
k.q = j
k.u = e
k.r = l
l.z = e
l.o = e
l.y = b
j.p = e
j.z = e
e.z = k
b.w = l
b.p = j
assert k.r.o.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: C = None
        self.u: D = None
        self.q: C = None
        self.r: B = None
        self.txt = txt

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

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

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

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

k = A("k")
l = B("l")
j = C("j")
e = D("e")
b = E("b")

k.y = b
k.t = j
k.q = j
k.u = e
k.r = l
l.z = e
l.o = e
l.y = b
j.p = e
j.z = e
e.z = k
b.w = l
b.p = j
assert k.r.o.z.t.txt == "j"