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

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

l = A("l")
k = B("k")
h = B("h")
f = B("f")
j = A("j")
c = B("c")
m = B("m")
i = B("i")

l.v = h
l.p = j
k.x = m
k.o = j
h.x = c
h.o = l
f.x = i
f.o = l
j.v = i
j.p = l
c.x = h
c.o = l
m.x = i
m.o = j
i.x = c
i.o = j
assert c.o.p.v.o.v.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: A = None
        self.txt = txt

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

l = A("l")
k = B("k")
h = B("h")
f = B("f")
j = A("j")
c = B("c")
m = B("m")
i = B("i")

l.v = h
l.p = j
k.x = m
k.o = j
h.x = c
h.o = l
f.x = i
f.o = l
j.v = i
j.p = l
c.x = h
c.o = l
m.x = i
m.o = j
i.x = c
i.o = j
assert c.o.p.v.o.v.x.x.txt == "h"