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

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

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

i.q = m
i.u = b
h.w = i
h.t = k
n.q = b
n.u = k
b.w = j
b.t = h
k.w = j
k.t = h
f.q = b
f.u = b
j.q = h
j.u = m
g.q = h
g.u = h
e.q = h
e.u = k
m.w = e
m.t = k
assert h.w.q.t.t.t.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: B = None
        self.txt = txt

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

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

i.q = m
i.u = b
h.w = i
h.t = k
n.q = b
n.u = k
b.w = j
b.t = h
k.w = j
k.t = h
f.q = b
f.u = b
j.q = h
j.u = m
g.q = h
g.u = h
e.q = h
e.u = k
m.w = e
m.t = k
assert h.w.q.t.t.t.w.u.txt == "m"