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

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: C = None
        self.s: C = None
        self.x: B = None
        self.txt = txt

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

c = A("c")
m = B("m")
l = C("l")
e = D("e")
d = E("d")

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: C = None
        self.s: C = None
        self.x: B = None
        self.txt = txt

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

c = A("c")
m = B("m")
l = C("l")
e = D("e")
d = E("d")

c.t = d
c.u = m
c.o = m
c.r = e
m.v = c
m.t = c
m.o = l
l.t = m
e.v = d
e.z = l
e.s = l
e.x = m
d.x = e
d.r = e
d.z = m
d.p = l
assert l.t.o.t.v.o.txt == "m"