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

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

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

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

l = A("l")
n = B("n")
c = C("c")
b = D("b")
j = C("j")
e = C("e")
m = D("m")

l.z = n
l.w = b
l.y = e
n.t = m
c.p = n
c.y = b
b.u = n
j.p = n
j.y = b
e.p = n
e.y = m
m.u = n
assert j.y.u.t.u.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: D = None
        self.y: C = None
        self.txt = txt

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

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

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

l = A("l")
n = B("n")
c = C("c")
b = D("b")
j = C("j")
e = C("e")
m = D("m")

l.z = n
l.w = b
l.y = e
n.t = m
c.p = n
c.y = b
b.u = n
j.p = n
j.y = b
e.p = n
e.y = m
m.u = n
assert j.y.u.t.u.t.u.txt == "n"