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

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

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

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

d = A("d")
j = B("j")
i = C("i")
c = D("c")
h = C("h")
m = C("m")
k = C("k")
n = D("n")
b = C("b")

d.s = h
d.q = j
j.p = n
i.q = j
i.p = j
i.u = c
i.t = c
c.u = k
h.q = j
h.p = j
h.u = n
h.t = n
m.q = j
m.p = j
m.u = c
m.t = c
k.q = j
k.p = j
k.u = c
k.t = c
n.u = b
b.q = j
b.p = j
b.u = n
b.t = n
assert n.u.t.u.q.p.u.t.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: B = None
        self.txt = txt

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

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

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

d = A("d")
j = B("j")
i = C("i")
c = D("c")
h = C("h")
m = C("m")
k = C("k")
n = D("n")
b = C("b")

d.s = h
d.q = j
j.p = n
i.q = j
i.p = j
i.u = c
i.t = c
c.u = k
h.q = j
h.p = j
h.u = n
h.t = n
m.q = j
m.p = j
m.u = c
m.t = c
k.q = j
k.p = j
k.u = c
k.t = c
n.u = b
b.q = j
b.p = j
b.u = n
b.t = n
assert n.u.t.u.q.p.u.t.u.t.txt == "n"