class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: H = None
        self.x: G = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: D = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: D = None
        self.t: C = None
        self.s: B = None
        self.z: H = None
        self.v: E = None
        self.u: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: D = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: D = None
        self.t: C = None
        self.s: B = None
        self.z: H = None
        self.v: E = None
        self.u: C = None
        self.txt = txt

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

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

n.t = a
n.r = g
n.x = b
n.v = c
c.x = m
c.v = g
i.o = c
m.o = i
m.w = i
a.z = d
l.o = c
l.y = m
l.u = g
b.p = i
b.t = i
b.u = i
b.w = m
b.s = c
b.z = g
b.v = a
g.z = c
g.x = n
g.o = i
g.t = l
k.t = a
k.r = g
k.x = d
k.v = c
d.p = i
d.t = i
d.u = i
d.w = m
d.s = c
d.z = g
d.v = a
assert m.o.o.v.z.x.o.o.v.o.txt == "i"