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

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

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

g = A("g")
m = B("m")
c = C("c")
i = B("i")
a = C("a")
e = A("e")
d = A("d")
k = C("k")

g.w = m
g.s = d
g.o = c
m.w = e
m.o = d
m.u = d
c.u = g
i.w = d
i.o = d
i.u = d
a.u = e
e.w = i
e.s = d
e.o = k
d.w = i
d.s = e
d.o = k
k.u = d
assert e.s.s.s.o.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: A = None
        self.o: C = None
        self.txt = txt

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

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

g = A("g")
m = B("m")
c = C("c")
i = B("i")
a = C("a")
e = A("e")
d = A("d")
k = C("k")

g.w = m
g.s = d
g.o = c
m.w = e
m.o = d
m.u = d
c.u = g
i.w = d
i.o = d
i.u = d
a.u = e
e.w = i
e.s = d
e.o = k
d.w = i
d.s = e
d.o = k
k.u = d
assert e.s.s.s.o.u.o.txt == "k"