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

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

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

a = A("a")
n = B("n")
l = C("l")
i = B("i")
c = C("c")
b = A("b")
m = B("m")
j = A("j")
g = C("g")
e = A("e")

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

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

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

a = A("a")
n = B("n")
l = C("l")
i = B("i")
c = C("c")
b = A("b")
m = B("m")
j = A("j")
g = C("g")
e = A("e")

a.y = j
a.o = e
n.v = i
n.z = a
l.z = g
i.v = n
i.z = a
c.z = l
b.y = e
b.o = j
m.v = n
m.z = a
j.y = b
j.o = a
g.z = c
e.y = b
e.o = j
assert b.o.y.o.y.y.o.o.o.o.txt == "j"