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

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

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

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

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

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

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

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

k.u = n
k.t = m
d.t = k
d.s = i
d.x = m
m.q = i
m.v = i
m.u = h
l.u = n
l.t = m
i.t = k
i.s = d
i.x = m
n.u = l
n.t = m
h.t = l
h.s = i
h.x = m
e.u = l
e.t = m
assert e.u.t.u.s.s.s.txt == "i"