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

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

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

e = A("e")
k = B("k")
n = C("n")
m = C("m")
l = C("l")
j = B("j")
c = C("c")
a = B("a")
d = B("d")
f = B("f")

e.z = k
k.v = j
k.y = e
n.t = l
n.z = f
m.t = c
m.z = k
l.t = m
l.z = k
j.v = d
j.y = e
c.t = n
c.z = k
a.v = f
a.y = e
d.v = a
d.y = e
f.v = j
f.y = e
assert j.v.y.z.y.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

e = A("e")
k = B("k")
n = C("n")
m = C("m")
l = C("l")
j = B("j")
c = C("c")
a = B("a")
d = B("d")
f = B("f")

e.z = k
k.v = j
k.y = e
n.t = l
n.z = f
m.t = c
m.z = k
l.t = m
l.z = k
j.v = d
j.y = e
c.t = n
c.z = k
a.v = f
a.y = e
d.v = a
d.y = e
f.v = j
f.y = e
assert j.v.y.z.y.z.y.txt == "e"