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

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

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

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

l = A("l")
a = B("a")
c = C("c")
h = D("h")

l.x = h
l.u = h
l.z = h
l.t = c
a.o = h
c.y = h
h.s = c
assert l.u.s.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: D = None
        self.t: C = None
        self.z: D = None
        self.txt = txt

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

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

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

l = A("l")
a = B("a")
c = C("c")
h = D("h")

l.x = h
l.u = h
l.z = h
l.t = c
a.o = h
c.y = h
h.s = c
assert l.u.s.y.s.txt == "c"