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

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

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

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

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

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

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

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

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