class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

e = A("e")
g = B("g")
b = C("b")
k = D("k")
h = D("h")
l = D("l")

e.u = b
g.t = b
b.o = g
b.z = g
b.v = g
k.x = h
h.x = l
l.x = h
assert h.x.x.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

e = A("e")
g = B("g")
b = C("b")
k = D("k")
h = D("h")
l = D("l")

e.u = b
g.t = b
b.o = g
b.z = g
b.v = g
k.x = h
h.x = l
l.x = h
assert h.x.x.x.x.x.txt == "l"