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

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

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

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

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

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

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

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

i.w = h
i.y = n
f.s = k
l.t = n
l.o = f
c.t = n
c.o = f
k.s = e
m.w = e
m.y = n
e.s = h
h.s = k
n.t = l
n.o = k
assert k.s.s.s.s.s.s.s.s.txt == "h"