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

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

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

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

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

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

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

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

h.t = i
l.u = h
i.s = h
k.u = h
n.s = h
assert i.s.t.s.t.s.txt == "h"