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

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

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

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

i.u = n
a.r = c
a.s = l
a.u = k
l.t = a
l.u = a
l.x = m
h.t = a
h.u = k
h.x = i
d.t = a
d.u = k
d.x = m
m.u = l
n.t = a
n.u = k
n.x = c
e.t = a
e.u = a
e.x = c
k.r = c
k.s = e
k.u = a
c.u = d
assert c.u.x.u.t.s.x.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

i.u = n
a.r = c
a.s = l
a.u = k
l.t = a
l.u = a
l.x = m
h.t = a
h.u = k
h.x = i
d.t = a
d.u = k
d.x = m
m.u = l
n.t = a
n.u = k
n.x = c
e.t = a
e.u = a
e.x = c
k.r = c
k.s = e
k.u = a
c.u = d
assert c.u.x.u.t.s.x.u.txt == "l"