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

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

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

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

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

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

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

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

k.z = e
k.s = b
b.w = g
b.u = k
b.s = e
n.p = e
n.z = k
i.p = e
i.z = k
a.p = b
a.z = m
e.w = k
e.u = g
e.s = b
c.p = b
c.z = m
g.z = b
g.s = e
m.z = e
m.s = e
j.p = e
j.z = g
assert c.z.z.u.s.w.z.u.txt == "g"