class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: F = None
        self.v: C = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: C = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: J = None
        self.w: G = None
        self.u: E = None
        self.r: E = None
        self.y: E = None
        self.q: E = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.t: F = None
        self.z: F = None
        self.q: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: C = None
        self.q: C = None
        self.p: J = None
        self.t: D = None
        self.z: J = None
        self.r: A = None
        self.x: B = None
        self.w: J = None
        self.s: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: B = None
        self.s: I = None
        self.t: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: C = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: J = None
        self.w: G = None
        self.u: E = None
        self.r: E = None
        self.y: E = None
        self.q: E = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.t: F = None
        self.z: F = None
        self.q: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: C = None
        self.q: C = None
        self.p: J = None
        self.t: D = None
        self.z: J = None
        self.r: A = None
        self.x: B = None
        self.w: J = None
        self.s: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: B = None
        self.s: I = None
        self.t: I = None
        self.txt = txt

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

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