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

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

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

f = A("f")
j = B("j")
l = C("l")
n = A("n")
i = C("i")
g = A("g")
m = A("m")
k = C("k")
c = A("c")

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

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

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

f = A("f")
j = B("j")
l = C("l")
n = A("n")
i = C("i")
g = A("g")
m = A("m")
k = C("k")
c = A("c")

f.t = j
f.o = j
f.z = j
j.p = g
l.z = n
n.t = j
n.o = j
n.z = j
i.z = m
g.t = j
g.o = j
g.z = j
m.t = j
m.o = j
m.z = j
k.z = n
c.t = j
c.o = j
c.z = j
assert f.o.p.z.p.z.p.txt == "g"