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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: F = None
        self.z: F = None
        self.w: A = None
        self.s: F = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: G = None
        self.u: F = None
        self.t: C = None
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: D = None
        self.w: D = None
        self.p: G = None
        self.t: E = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: A = None
        self.q: A = None
        self.s: B = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: H = None
        self.t: A = None
        self.p: F = None
        self.r: F = None
        self.x: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: F = None
        self.z: F = None
        self.w: A = None
        self.s: F = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: G = None
        self.u: F = None
        self.t: C = None
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: D = None
        self.w: D = None
        self.p: G = None
        self.t: E = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: A = None
        self.q: A = None
        self.s: B = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: H = None
        self.t: A = None
        self.p: F = None
        self.r: F = None
        self.x: H = None
        self.txt = txt

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

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