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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: F = None
        self.u: G = None
        self.y: H = None
        self.z: G = None
        self.r: F = None
        self.o: I = None
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: H = None
        self.s: F = None
        self.p: B = None
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: H = None
        self.w: I = None
        self.p: B = None
        self.q: H = None
        self.x: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: F = None
        self.r: B = None
        self.s: F = None
        self.t: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: B = None
        self.q: D = None
        self.u: F = None
        self.v: A = None
        self.r: G = None
        self.y: B = None
        self.t: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: F = None
        self.x: E = None
        self.txt = txt

g = A("g")
l = B("l")
j = C("j")
n = D("n")
m = E("m")
h = F("h")
b = G("b")
f = H("f")
c = I("c")
d = E("d")

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: F = None
        self.u: G = None
        self.y: H = None
        self.z: G = None
        self.r: F = None
        self.o: I = None
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: H = None
        self.s: F = None
        self.p: B = None
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: H = None
        self.w: I = None
        self.p: B = None
        self.q: H = None
        self.x: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: F = None
        self.r: B = None
        self.s: F = None
        self.t: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: B = None
        self.q: D = None
        self.u: F = None
        self.v: A = None
        self.r: G = None
        self.y: B = None
        self.t: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: F = None
        self.x: E = None
        self.txt = txt

g = A("g")
l = B("l")
j = C("j")
n = D("n")
m = E("m")
h = F("h")
b = G("b")
f = H("f")
c = I("c")
d = E("d")

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