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

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

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

c = A("c")
d = B("d")
l = C("l")
i = B("i")
k = A("k")
a = C("a")
e = A("e")
b = A("b")
n = B("n")
g = B("g")

c.t = l
d.q = n
d.z = a
d.x = i
l.u = k
l.y = a
i.q = n
i.x = n
i.z = a
k.t = a
a.u = c
a.y = l
e.t = a
b.t = l
n.q = d
n.z = l
n.x = g
g.q = n
g.x = n
g.z = a
assert g.z.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

c = A("c")
d = B("d")
l = C("l")
i = B("i")
k = A("k")
a = C("a")
e = A("e")
b = A("b")
n = B("n")
g = B("g")

c.t = l
d.q = n
d.z = a
d.x = i
l.u = k
l.y = a
i.q = n
i.x = n
i.z = a
k.t = a
a.u = c
a.y = l
e.t = a
b.t = l
n.q = d
n.z = l
n.x = g
g.q = n
g.x = n
g.z = a
assert g.z.u.t.txt == "l"