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

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

d = A("d")
b = B("b")
m = A("m")
k = A("k")
e = B("e")
a = A("a")
g = A("g")
l = A("l")
c = B("c")

d.s = b
d.v = a
b.z = m
b.o = e
m.s = c
m.v = g
k.s = c
k.v = g
e.z = k
e.o = b
a.s = b
a.v = l
g.s = e
g.v = l
l.s = e
l.v = g
c.z = g
c.o = e
assert c.o.z.v.v.s.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: A = None
        self.txt = txt

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

d = A("d")
b = B("b")
m = A("m")
k = A("k")
e = B("e")
a = A("a")
g = A("g")
l = A("l")
c = B("c")

d.s = b
d.v = a
b.z = m
b.o = e
m.s = c
m.v = g
k.s = c
k.v = g
e.z = k
e.o = b
a.s = b
a.v = l
g.s = e
g.v = l
l.s = e
l.v = g
c.z = g
c.o = e
assert c.o.z.v.v.s.o.o.txt == "e"