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

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

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

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

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

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

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

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

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