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

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

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

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

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

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

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

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

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