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

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

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

c = A("c")
h = B("h")
i = C("i")
l = B("l")
n = A("n")
f = B("f")
m = A("m")
j = B("j")
a = C("a")
k = C("k")

c.t = i
h.t = j
h.y = a
h.x = m
i.s = n
i.t = a
i.y = f
l.t = f
l.y = k
l.x = m
n.t = a
f.t = l
f.y = i
f.x = c
m.t = a
j.t = f
j.y = i
j.x = c
a.s = m
a.t = i
a.y = j
k.s = m
k.t = a
k.y = j
assert h.t.t.x.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.t: B = None
        self.y: C = None
        self.x: A = None
        self.txt = txt

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

c = A("c")
h = B("h")
i = C("i")
l = B("l")
n = A("n")
f = B("f")
m = A("m")
j = B("j")
a = C("a")
k = C("k")

c.t = i
h.t = j
h.y = a
h.x = m
i.s = n
i.t = a
i.y = f
l.t = f
l.y = k
l.x = m
n.t = a
f.t = l
f.y = i
f.x = c
m.t = a
j.t = f
j.y = i
j.x = c
a.s = m
a.t = i
a.y = j
k.s = m
k.t = a
k.y = j
assert h.t.t.x.t.s.txt == "n"