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

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

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

h = A("h")
d = B("d")
k = C("k")
i = A("i")
e = C("e")
n = A("n")
a = C("a")
f = B("f")
c = C("c")
g = A("g")

h.x = c
h.o = d
d.s = e
d.x = f
d.w = f
k.v = g
i.x = c
i.o = f
e.v = n
n.x = e
n.o = d
a.v = g
f.s = k
f.x = d
f.w = d
c.v = g
g.x = c
g.o = d
assert e.v.o.x.x.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: B = None
        self.txt = txt

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

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

h = A("h")
d = B("d")
k = C("k")
i = A("i")
e = C("e")
n = A("n")
a = C("a")
f = B("f")
c = C("c")
g = A("g")

h.x = c
h.o = d
d.s = e
d.x = f
d.w = f
k.v = g
i.x = c
i.o = f
e.v = n
n.x = e
n.o = d
a.v = g
f.s = k
f.x = d
f.w = d
c.v = g
g.x = c
g.o = d
assert e.v.o.x.x.w.s.txt == "k"