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

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

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

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

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

a = A("a")
j = B("j")
b = C("b")
m = D("m")
c = E("c")

a.t = j
j.t = c
b.t = m
m.w = j
m.z = j
m.y = j
m.v = b
m.u = c
c.z = m
assert m.u.z.v.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

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

a = A("a")
j = B("j")
b = C("b")
m = D("m")
c = E("c")

a.t = j
j.t = c
b.t = m
m.w = j
m.z = j
m.y = j
m.v = b
m.u = c
c.z = m
assert m.u.z.v.t.z.txt == "j"