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

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

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

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

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

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

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

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

j.t = c
j.q = n
f.z = d
f.q = d
a.t = c
a.y = d
n.z = a
n.q = d
l.z = d
l.q = a
e.z = d
e.q = d
d.t = i
d.y = a
i.t = c
i.q = l
c.t = i
c.q = e
assert l.z.t.q.q.t.t.txt == "i"