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

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

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

k = A("k")
g = B("g")
b = C("b")
m = B("m")
a = A("a")
i = B("i")
h = C("h")
l = A("l")
e = C("e")

k.z = h
k.u = a
g.v = h
b.p = k
b.s = e
m.v = h
a.z = h
a.u = l
i.v = e
h.p = a
h.s = b
l.z = e
l.u = a
e.p = k
e.s = h
assert g.v.p.u.z.p.z.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: A = None
        self.txt = txt

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

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

k = A("k")
g = B("g")
b = C("b")
m = B("m")
a = A("a")
i = B("i")
h = C("h")
l = A("l")
e = C("e")

k.z = h
k.u = a
g.v = h
b.p = k
b.s = e
m.v = h
a.z = h
a.u = l
i.v = e
h.p = a
h.s = b
l.z = e
l.u = a
e.p = k
e.s = h
assert g.v.p.u.z.p.z.s.s.txt == "e"