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

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

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

i = A("i")
n = B("n")
a = C("a")
k = B("k")
e = A("e")
b = A("b")
c = B("c")
g = B("g")
h = C("h")

i.w = k
i.t = g
n.s = a
a.u = h
a.x = h
k.s = h
e.w = n
e.t = n
b.w = n
b.t = n
c.s = h
g.s = a
h.u = a
h.x = a
assert n.s.x.u.u.u.u.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: B = None
        self.txt = txt

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

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

i = A("i")
n = B("n")
a = C("a")
k = B("k")
e = A("e")
b = A("b")
c = B("c")
g = B("g")
h = C("h")

i.w = k
i.t = g
n.s = a
a.u = h
a.x = h
k.s = h
e.w = n
e.t = n
b.w = n
b.t = n
c.s = h
g.s = a
h.u = a
h.x = a
assert n.s.x.u.u.u.u.x.x.txt == "h"