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

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

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

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

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

c = A("c")
a = B("a")
l = C("l")
d = D("d")
n = E("n")
b = A("b")
e = E("e")

c.z = a
c.w = l
c.p = l
a.t = l
a.o = n
a.x = d
l.o = a
d.r = n
d.t = l
n.z = l
n.r = l
b.z = a
b.w = l
b.p = l
e.z = l
e.r = l
assert d.t.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

c = A("c")
a = B("a")
l = C("l")
d = D("d")
n = E("n")
b = A("b")
e = E("e")

c.z = a
c.w = l
c.p = l
a.t = l
a.o = n
a.x = d
l.o = a
d.r = n
d.t = l
n.z = l
n.r = l
b.z = a
b.w = l
b.p = l
e.z = l
e.r = l
assert d.t.o.t.txt == "l"