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

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

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

e = A("e")
d = B("d")
c = C("c")
l = C("l")

e.t = d
d.z = l
c.o = d
c.w = d
c.z = l
l.o = d
l.w = d
l.z = c
assert l.w.z.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

e = A("e")
d = B("d")
c = C("c")
l = C("l")

e.t = d
d.z = l
c.o = d
c.w = d
c.z = l
l.o = d
l.w = d
l.z = c
assert l.w.z.o.z.txt == "l"