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

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

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

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

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

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

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

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

e.u = c
e.o = k
e.q = m
l.t = c
c.r = e
c.y = j
c.t = j
k.u = d
k.o = e
k.q = m
j.t = d
m.t = c
d.r = e
d.y = m
d.t = l
i.r = k
i.y = j
i.t = l
assert k.q.t.r.txt == "e"