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

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

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

n = A("n")
i = B("i")
a = C("a")
h = A("h")
c = C("c")
e = A("e")
j = A("j")
k = C("k")
d = C("d")
g = A("g")

n.z = i
n.p = d
n.y = g
i.s = c
i.q = a
a.z = c
h.z = i
h.p = a
h.y = j
c.z = k
e.z = i
e.p = c
e.y = g
j.z = i
j.p = a
j.y = g
k.z = c
d.z = a
g.z = i
g.p = k
g.y = j
assert c.z.z.z.z.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: C = None
        self.y: A = None
        self.txt = txt

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

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

n = A("n")
i = B("i")
a = C("a")
h = A("h")
c = C("c")
e = A("e")
j = A("j")
k = C("k")
d = C("d")
g = A("g")

n.z = i
n.p = d
n.y = g
i.s = c
i.q = a
a.z = c
h.z = i
h.p = a
h.y = j
c.z = k
e.z = i
e.p = c
e.y = g
j.z = i
j.p = a
j.y = g
k.z = c
d.z = a
g.z = i
g.p = k
g.y = j
assert c.z.z.z.z.z.z.z.txt == "k"