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

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

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

g = A("g")
d = B("d")
n = C("n")
l = B("l")
m = B("m")
f = A("f")
i = C("i")
e = B("e")
k = B("k")

g.w = m
d.p = i
d.t = i
d.w = e
n.z = i
l.p = i
l.w = m
l.t = n
m.p = n
m.t = n
m.w = e
f.w = e
i.z = n
e.p = n
e.t = n
e.w = d
k.p = n
k.t = n
k.w = d
assert e.p.z.z.z.z.z.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

g = A("g")
d = B("d")
n = C("n")
l = B("l")
m = B("m")
f = A("f")
i = C("i")
e = B("e")
k = B("k")

g.w = m
d.p = i
d.t = i
d.w = e
n.z = i
l.p = i
l.w = m
l.t = n
m.p = n
m.t = n
m.w = e
f.w = e
i.z = n
e.p = n
e.t = n
e.w = d
k.p = n
k.t = n
k.w = d
assert e.p.z.z.z.z.z.z.z.z.txt == "n"