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

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

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

i = A("i")
e = B("e")
b = C("b")
h = B("h")
j = C("j")
m = A("m")
c = A("c")
f = B("f")
l = A("l")
a = A("a")

i.z = a
i.v = b
e.y = m
e.v = l
b.v = i
b.z = f
h.y = m
h.v = l
j.v = i
j.z = e
m.z = l
m.v = b
c.z = l
c.v = b
f.y = l
f.v = m
l.z = m
l.v = b
a.z = i
a.v = j
assert f.v.z.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: C = None
        self.txt = txt

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

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

i = A("i")
e = B("e")
b = C("b")
h = B("h")
j = C("j")
m = A("m")
c = A("c")
f = B("f")
l = A("l")
a = A("a")

i.z = a
i.v = b
e.y = m
e.v = l
b.v = i
b.z = f
h.y = m
h.v = l
j.v = i
j.z = e
m.z = l
m.v = b
c.z = l
c.v = b
f.y = l
f.v = m
l.z = m
l.v = b
a.z = i
a.v = j
assert f.v.z.v.v.txt == "i"