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

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

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

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

e.v = b
e.p = a
n.o = l
n.s = i
j.x = l
j.s = i
b.o = g
b.s = e
l.o = g
l.s = e
g.o = m
g.s = e
i.v = m
i.p = l
a.o = b
a.s = e
m.o = a
m.s = i
assert j.s.p.o.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: B = None
        self.txt = txt

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

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

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

e.v = b
e.p = a
n.o = l
n.s = i
j.x = l
j.s = i
b.o = g
b.s = e
l.o = g
l.s = e
g.o = m
g.s = e
i.v = m
i.p = l
a.o = b
a.s = e
m.o = a
m.s = i
assert j.s.p.o.s.v.txt == "b"