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

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

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

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

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

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

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

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

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