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

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

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

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

c = A("c")
j = B("j")
n = C("n")
l = D("l")
h = A("h")
k = B("k")
a = C("a")
i = D("i")

c.r = l
j.y = i
j.z = n
j.u = n
n.s = l
n.x = j
l.p = h
l.r = n
l.t = i
h.r = l
k.y = l
k.z = n
k.u = a
a.s = i
a.x = k
i.p = h
i.r = a
i.t = l
assert l.t.t.p.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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

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

c = A("c")
j = B("j")
n = C("n")
l = D("l")
h = A("h")
k = B("k")
a = C("a")
i = D("i")

c.r = l
j.y = i
j.z = n
j.u = n
n.s = l
n.x = j
l.p = h
l.r = n
l.t = i
h.r = l
k.y = l
k.z = n
k.u = a
a.s = i
a.x = k
i.p = h
i.r = a
i.t = l
assert l.t.t.p.r.r.txt == "n"