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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: C = None
        self.o: E = None
        self.p: F = None
        self.u: C = None
        self.v: A = None
        self.r: G = None
        self.t: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: G = None
        self.x: D = None
        self.r: D = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: B = None
        self.x: H = None
        self.q: C = None
        self.t: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: H = None
        self.u: A = None
        self.x: B = None
        self.txt = txt

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

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

h.o = m
f.x = e
f.q = k
f.u = k
f.o = n
f.p = m
f.v = h
f.r = b
f.t = i
k.q = n
k.v = b
k.x = d
k.r = g
k.u = i
g.u = d
g.r = f
g.t = f
g.x = i
g.q = k
e.t = k
e.o = d
e.w = i
e.p = i
e.r = h
e.q = f
e.x = f
m.v = h
b.p = k
b.t = i
b.u = h
b.x = f
i.r = f
i.z = f
i.x = h
n.t = k
n.o = d
n.w = i
n.p = i
n.r = h
n.q = f
n.x = f
d.u = g
d.r = f
d.t = f
d.x = i
d.q = k
assert m.v.o.v.o.v.o.v.o.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: C = None
        self.o: E = None
        self.p: F = None
        self.u: C = None
        self.v: A = None
        self.r: G = None
        self.t: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: G = None
        self.x: D = None
        self.r: D = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: B = None
        self.x: H = None
        self.q: C = None
        self.t: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: H = None
        self.u: A = None
        self.x: B = None
        self.txt = txt

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

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

h.o = m
f.x = e
f.q = k
f.u = k
f.o = n
f.p = m
f.v = h
f.r = b
f.t = i
k.q = n
k.v = b
k.x = d
k.r = g
k.u = i
g.u = d
g.r = f
g.t = f
g.x = i
g.q = k
e.t = k
e.o = d
e.w = i
e.p = i
e.r = h
e.q = f
e.x = f
m.v = h
b.p = k
b.t = i
b.u = h
b.x = f
i.r = f
i.z = f
i.x = h
n.t = k
n.o = d
n.w = i
n.p = i
n.r = h
n.q = f
n.x = f
d.u = g
d.r = f
d.t = f
d.x = i
d.q = k
assert m.v.o.v.o.v.o.v.o.v.o.txt == "m"