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

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

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

c = A("c")
m = B("m")
a = C("a")
k = B("k")
i = A("i")
d = C("d")
l = B("l")
h = A("h")
b = B("b")

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

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

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

c = A("c")
m = B("m")
a = C("a")
k = B("k")
i = A("i")
d = C("d")
l = B("l")
h = A("h")
b = B("b")

c.u = i
c.v = b
m.z = a
m.o = c
a.z = d
a.u = d
a.y = d
k.z = d
k.o = c
i.u = h
i.v = b
d.z = a
d.u = a
d.y = a
l.z = a
l.o = c
h.u = c
h.v = m
b.z = a
b.o = i
assert m.o.u.v.o.u.v.o.v.z.txt == "a"