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

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

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

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

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

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

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

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

c.q = l
i.y = a
i.u = e
d.o = i
d.t = j
d.x = h
m.y = a
m.u = c
l.y = d
l.u = e
j.o = m
j.t = a
j.x = h
h.q = m
a.o = l
a.t = j
a.x = e
e.q = i
assert j.o.u.q.u.q.txt == "i"