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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

k.z = g
k.s = l
l.s = h
b.z = h
g.x = b
g.t = n
g.u = i
g.q = i
d.q = l
h.q = n
i.x = b
i.t = n
i.u = g
i.q = g
n.s = d
j.z = g
j.s = l
c.q = l
assert b.z.q.s.q.s.q.s.q.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

k.z = g
k.s = l
l.s = h
b.z = h
g.x = b
g.t = n
g.u = i
g.q = i
d.q = l
h.q = n
i.x = b
i.t = n
i.u = g
i.q = g
n.s = d
j.z = g
j.s = l
c.q = l
assert b.z.q.s.q.s.q.s.q.s.q.txt == "n"