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

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

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

h = A("h")
n = B("n")
l = C("l")
e = C("e")
i = C("i")
k = C("k")
j = C("j")
c = B("c")

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

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

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

h = A("h")
n = B("n")
l = C("l")
e = C("e")
i = C("i")
k = C("k")
j = C("j")
c = B("c")

h.s = c
h.u = c
h.o = l
n.o = j
n.t = c
l.t = h
l.x = h
l.s = c
e.t = h
e.x = h
e.s = c
i.t = h
i.x = h
i.s = n
k.t = h
k.x = h
k.s = n
j.t = h
j.x = h
j.s = c
c.o = i
c.t = n
assert j.s.t.t.o.s.txt == "n"