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

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

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

l = A("l")
d = B("d")
f = C("f")
c = C("c")
h = A("h")
j = A("j")
e = B("e")
k = C("k")
a = A("a")
i = C("i")

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

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

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

l = A("l")
d = B("d")
f = C("f")
c = C("c")
h = A("h")
j = A("j")
e = B("e")
k = C("k")
a = A("a")
i = C("i")

l.u = f
l.q = d
l.t = i
d.z = k
f.u = i
f.q = c
c.u = k
c.q = k
h.u = f
h.q = e
h.t = c
j.u = k
j.q = e
j.t = i
e.z = c
k.u = c
k.q = i
a.u = k
a.q = d
a.t = f
i.u = c
i.q = f
assert j.q.z.q.q.u.u.txt == "k"