class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: H = None
        self.t: G = None
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: H = None
        self.y: F = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: A = None
        self.q: E = None
        self.o: A = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: B = None
        self.x: A = None
        self.p: E = None
        self.w: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: F = None
        self.t: B = None
        self.w: B = None
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: H = None
        self.txt = txt

a = A("a")
k = B("k")
n = C("n")
d = D("d")
l = E("l")
h = F("h")
i = G("i")
g = H("g")
f = F("f")
m = H("m")

a.o = n
a.v = m
a.x = m
a.t = i
k.v = a
k.s = m
k.y = h
k.u = i
n.w = g
n.y = a
n.o = a
n.q = l
n.s = d
d.t = m
d.q = k
d.x = a
d.p = l
d.w = g
l.z = k
l.w = d
h.z = i
i.o = g
i.x = f
i.t = k
i.w = k
i.s = n
g.y = h
g.w = m
f.z = i
m.y = h
m.w = g
assert f.z.s.q.w.p.w.x.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: H = None
        self.t: G = None
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: H = None
        self.y: F = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: A = None
        self.q: E = None
        self.o: A = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: B = None
        self.x: A = None
        self.p: E = None
        self.w: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: F = None
        self.t: B = None
        self.w: B = None
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: H = None
        self.txt = txt

a = A("a")
k = B("k")
n = C("n")
d = D("d")
l = E("l")
h = F("h")
i = G("i")
g = H("g")
f = F("f")
m = H("m")

a.o = n
a.v = m
a.x = m
a.t = i
k.v = a
k.s = m
k.y = h
k.u = i
n.w = g
n.y = a
n.o = a
n.q = l
n.s = d
d.t = m
d.q = k
d.x = a
d.p = l
d.w = g
l.z = k
l.w = d
h.z = i
i.o = g
i.x = f
i.t = k
i.w = k
i.s = n
g.y = h
g.w = m
f.z = i
m.y = h
m.w = g
assert f.z.s.q.w.p.w.x.t.s.txt == "n"