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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: C = None
        self.y: C = None
        self.u: D = None
        self.s: D = None
        self.q: C = None
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: H = None
        self.x: I = None
        self.y: A = None
        self.p: E = None
        self.z: A = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: H = None
        self.x: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: J = None
        self.o: G = None
        self.z: C = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.z: B = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: D = None
        self.p: B = None
        self.o: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: E = None
        self.t: D = None
        self.v: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: C = None
        self.y: C = None
        self.u: D = None
        self.s: D = None
        self.q: C = None
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: H = None
        self.x: I = None
        self.y: A = None
        self.p: E = None
        self.z: A = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: H = None
        self.x: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: J = None
        self.o: G = None
        self.z: C = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.z: B = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: D = None
        self.p: B = None
        self.o: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: E = None
        self.t: D = None
        self.v: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: H = None
        self.txt = txt

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

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