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

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

class C:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: C = None
        self.txt = txt

k = A("k")
m = B("m")
h = C("h")
l = A("l")
e = C("e")
b = A("b")
c = A("c")
n = B("n")
a = B("a")
g = A("g")

k.z = h
k.u = h
m.o = h
m.q = h
h.o = e
h.r = e
l.z = e
l.u = e
e.o = h
e.r = h
b.z = e
b.u = e
c.z = h
c.u = e
n.o = h
n.q = h
a.o = e
a.q = e
g.z = h
g.u = h
assert e.o.r.o.o.r.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: C = None
        self.txt = txt

k = A("k")
m = B("m")
h = C("h")
l = A("l")
e = C("e")
b = A("b")
c = A("c")
n = B("n")
a = B("a")
g = A("g")

k.z = h
k.u = h
m.o = h
m.q = h
h.o = e
h.r = e
l.z = e
l.u = e
e.o = h
e.r = h
b.z = e
b.u = e
c.z = h
c.u = e
n.o = h
n.q = h
a.o = e
a.q = e
g.z = h
g.u = h
assert e.o.r.o.o.r.o.r.txt == "h"