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

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

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

k = A("k")
j = B("j")
f = C("f")
n = A("n")
g = B("g")
h = C("h")
a = C("a")
c = B("c")
b = B("b")
m = C("m")

k.z = g
k.x = g
k.t = b
j.v = n
j.o = m
f.s = c
n.z = j
n.x = b
n.t = c
g.v = n
g.o = f
h.s = b
a.s = j
c.v = n
c.o = h
b.v = n
b.o = f
m.s = j
assert m.s.o.s.v.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: B = None
        self.t: B = None
        self.txt = txt

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

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

k = A("k")
j = B("j")
f = C("f")
n = A("n")
g = B("g")
h = C("h")
a = C("a")
c = B("c")
b = B("b")
m = C("m")

k.z = g
k.x = g
k.t = b
j.v = n
j.o = m
f.s = c
n.z = j
n.x = b
n.t = c
g.v = n
g.o = f
h.s = b
a.s = j
c.v = n
c.o = h
b.v = n
b.o = f
m.s = j
assert m.s.o.s.v.z.o.txt == "m"