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

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

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

e = A("e")
c = B("c")
f = C("f")
n = B("n")
i = C("i")
j = C("j")
g = C("g")
a = A("a")
h = C("h")
l = C("l")

e.t = i
e.v = c
e.z = a
c.v = e
f.p = j
n.v = e
i.p = j
j.p = g
g.p = j
a.t = l
a.v = n
a.z = e
h.p = l
l.p = h
assert e.t.p.p.p.p.p.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: B = None
        self.z: A = None
        self.txt = txt

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

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

e = A("e")
c = B("c")
f = C("f")
n = B("n")
i = C("i")
j = C("j")
g = C("g")
a = A("a")
h = C("h")
l = C("l")

e.t = i
e.v = c
e.z = a
c.v = e
f.p = j
n.v = e
i.p = j
j.p = g
g.p = j
a.t = l
a.v = n
a.z = e
h.p = l
l.p = h
assert e.t.p.p.p.p.p.p.p.txt == "j"