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

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

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

c.o = e
c.v = k
k.w = a
a.o = e
a.v = n
e.o = c
e.v = k
b.o = a
b.v = n
n.w = c
h.o = c
h.v = n
l.o = e
l.v = n
assert n.w.o.v.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: B = None
        self.txt = txt

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

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

c.o = e
c.v = k
k.w = a
a.o = e
a.v = n
e.o = c
e.v = k
b.o = a
b.v = n
n.w = c
h.o = c
h.v = n
l.o = e
l.v = n
assert n.w.o.v.w.v.txt == "n"