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

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

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

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

n = A("n")
i = B("i")
h = C("h")
j = D("j")
b = C("b")
k = C("k")
l = C("l")
f = C("f")

n.r = j
n.u = j
n.o = j
i.t = n
h.q = j
j.s = n
b.q = j
k.q = j
l.q = j
f.q = j
assert i.t.r.s.u.s.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: D = None
        self.o: D = None
        self.txt = txt

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

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

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

n = A("n")
i = B("i")
h = C("h")
j = D("j")
b = C("b")
k = C("k")
l = C("l")
f = C("f")

n.r = j
n.u = j
n.o = j
i.t = n
h.q = j
j.s = n
b.q = j
k.q = j
l.q = j
f.q = j
assert i.t.r.s.u.s.u.s.txt == "n"