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

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

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

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

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

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

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

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

b.z = h
b.o = e
d.y = b
d.u = j
k.t = h
k.o = d
k.u = i
h.t = k
h.o = e
h.u = b
i.z = h
i.o = d
a.y = c
a.u = j
c.z = k
c.o = a
m.z = k
m.o = a
e.y = m
e.u = a
j.y = m
j.u = a
assert c.o.u.y.o.u.y.z.u.o.txt == "d"