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

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

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

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

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

l.u = e
i.s = n
d.s = a
d.x = e
e.z = d
e.t = l
n.u = e
c.s = n
m.u = e
b.z = a
b.t = m
a.s = d
a.x = e
assert c.s.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

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

l.u = e
i.s = n
d.s = a
d.x = e
e.z = d
e.t = l
n.u = e
c.s = n
m.u = e
b.z = a
b.t = m
a.s = d
a.x = e
assert c.s.u.z.txt == "d"