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

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

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

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

n = A("n")
l = B("l")
a = C("a")
j = D("j")
m = B("m")

n.u = j
l.s = a
a.o = j
a.t = j
a.y = j
j.t = m
m.s = a
assert j.t.s.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

n = A("n")
l = B("l")
a = C("a")
j = D("j")
m = B("m")

n.u = j
l.s = a
a.o = j
a.t = j
a.y = j
j.t = m
m.s = a
assert j.t.s.y.t.txt == "m"