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

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

m = A("m")
j = B("j")
n = A("n")
h = A("h")
f = B("f")
e = A("e")
l = A("l")
i = B("i")
b = B("b")
k = A("k")

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

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

m = A("m")
j = B("j")
n = A("n")
h = A("h")
f = B("f")
e = A("e")
l = A("l")
i = B("i")
b = B("b")
k = A("k")

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