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

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

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

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

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

l = A("l")
m = B("m")
b = C("b")
j = D("j")
d = E("d")

l.t = m
l.p = m
l.v = j
l.z = j
l.x = j
m.v = l
b.s = j
b.t = j
b.q = d
j.z = m
j.r = m
j.p = m
j.u = l
d.p = b
d.r = l
d.y = l
d.o = j
assert b.t.u.p.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: D = None
        self.z: D = None
        self.x: D = None
        self.p: B = None
        self.txt = txt

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

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

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

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

l = A("l")
m = B("m")
b = C("b")
j = D("j")
d = E("d")

l.t = m
l.p = m
l.v = j
l.z = j
l.x = j
m.v = l
b.s = j
b.t = j
b.q = d
j.z = m
j.r = m
j.p = m
j.u = l
d.p = b
d.r = l
d.y = l
d.o = j
assert b.t.u.p.v.v.txt == "j"