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

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

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

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

k = A("k")
d = B("d")
e = C("e")
n = D("n")
f = A("f")
l = B("l")
i = C("i")
m = A("m")
j = A("j")
g = B("g")

k.s = n
d.o = g
d.v = e
d.s = n
e.v = f
e.z = i
e.x = i
n.z = g
n.o = j
f.s = n
l.o = g
l.v = e
l.s = n
i.v = j
i.z = e
i.x = e
m.s = n
j.s = n
g.o = l
g.v = e
g.s = n
assert m.s.z.v.v.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

k = A("k")
d = B("d")
e = C("e")
n = D("n")
f = A("f")
l = B("l")
i = C("i")
m = A("m")
j = A("j")
g = B("g")

k.s = n
d.o = g
d.v = e
d.s = n
e.v = f
e.z = i
e.x = i
n.z = g
n.o = j
f.s = n
l.o = g
l.v = e
l.s = n
i.v = j
i.z = e
i.x = e
m.s = n
j.s = n
g.o = l
g.v = e
g.s = n
assert m.s.z.v.v.s.o.txt == "j"