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

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

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

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

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

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

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

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

n.u = c
n.x = c
n.w = l
i.s = l
i.o = h
k.s = f
k.w = h
l.s = f
l.w = h
a.u = c
a.w = c
a.x = l
h.s = c
h.o = i
f.u = c
f.w = c
f.x = l
m.u = k
m.x = k
m.w = k
c.s = f
c.w = h
assert c.s.u.w.s.w.s.s.w.s.txt == "f"