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

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

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

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

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

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

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

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

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