class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: C = None
        self.txt = txt

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

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

l = A("l")
b = B("b")
f = C("f")
h = C("h")
d = B("d")
e = B("e")
g = C("g")
i = C("i")
m = C("m")
a = C("a")

l.s = g
l.q = h
b.t = e
b.u = d
b.z = i
f.o = l
f.u = b
h.o = l
h.u = d
d.t = e
d.u = b
d.z = m
e.t = d
e.u = b
e.z = f
g.o = l
g.u = b
i.o = l
i.u = e
m.o = l
m.u = e
a.o = l
a.u = b
assert b.z.u.z.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: C = None
        self.txt = txt

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

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

l = A("l")
b = B("b")
f = C("f")
h = C("h")
d = B("d")
e = B("e")
g = C("g")
i = C("i")
m = C("m")
a = C("a")

l.s = g
l.q = h
b.t = e
b.u = d
b.z = i
f.o = l
f.u = b
h.o = l
h.u = d
d.t = e
d.u = b
d.z = m
e.t = d
e.u = b
e.z = f
g.o = l
g.u = b
i.o = l
i.u = e
m.o = l
m.u = e
a.o = l
a.u = b
assert b.z.u.z.o.q.txt == "h"