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

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

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

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

n.v = a
n.r = l
n.z = h
l.s = n
l.o = k
l.y = a
a.u = n
a.w = l
m.s = h
m.o = k
m.y = a
k.v = a
k.r = b
k.z = n
e.s = n
e.o = n
e.y = a
h.v = a
h.r = l
h.z = n
b.s = h
b.o = k
b.y = a
assert n.z.r.y.w.y.w.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: B = None
        self.z: A = None
        self.txt = txt

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

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

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

n.v = a
n.r = l
n.z = h
l.s = n
l.o = k
l.y = a
a.u = n
a.w = l
m.s = h
m.o = k
m.y = a
k.v = a
k.r = b
k.z = n
e.s = n
e.o = n
e.y = a
h.v = a
h.r = l
h.z = n
b.s = h
b.o = k
b.y = a
assert n.z.r.y.w.y.w.o.z.txt == "n"