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

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

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

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

l = A("l")
i = B("i")
f = C("f")
c = D("c")

l.u = c
l.p = i
i.q = c
i.v = f
f.z = i
f.t = i
f.o = i
f.y = i
c.x = f
c.y = f
assert l.u.y.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: B = None
        self.txt = txt

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

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

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

l = A("l")
i = B("i")
f = C("f")
c = D("c")

l.u = c
l.p = i
i.q = c
i.v = f
f.z = i
f.t = i
f.o = i
f.y = i
c.x = f
c.y = f
assert l.u.y.t.v.txt == "f"