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

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

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

e = A("e")
j = B("j")
h = C("h")
m = C("m")
g = A("g")
f = C("f")
a = B("a")
k = A("k")
b = A("b")
l = A("l")

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

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

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

e = A("e")
j = B("j")
h = C("h")
m = C("m")
g = A("g")
f = C("f")
a = B("a")
k = A("k")
b = A("b")
l = A("l")

e.z = k
e.u = l
j.t = a
h.q = b
h.r = b
h.u = f
m.q = b
m.r = b
m.u = h
g.z = k
g.u = l
f.q = g
f.r = b
f.u = h
a.t = j
k.z = b
k.u = b
b.z = g
b.u = l
l.z = k
l.u = b
assert e.u.z.u.z.z.z.txt == "b"