class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: D = None
        self.t: A = None
        self.s: F = None
        self.r: H = None
        self.x: H = None
        self.y: C = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: A = None
        self.y: C = None
        self.s: C = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: A = None
        self.w: E = None
        self.u: G = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: F = None
        self.z: E = None
        self.r: A = None
        self.w: B = None
        self.y: F = None
        self.x: A = None
        self.v: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: C = None
        self.o: D = None
        self.r: B = None
        self.x: A = None
        self.z: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: A = None
        self.y: C = None
        self.s: C = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: A = None
        self.w: E = None
        self.u: G = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: F = None
        self.z: E = None
        self.r: A = None
        self.w: B = None
        self.y: F = None
        self.x: A = None
        self.v: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: C = None
        self.o: D = None
        self.r: B = None
        self.x: A = None
        self.z: B = None
        self.txt = txt

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

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