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

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: I = None
        self.o: H = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: C = None
        self.p: H = None
        self.o: G = None
        self.q: E = None
        self.w: E = None
        self.x: I = None
        self.v: J = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: B = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: D = None
        self.x: J = None
        self.t: A = None
        self.w: C = None
        self.s: J = None
        self.r: H = None
        self.y: J = None
        self.o: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: I = None
        self.o: H = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: C = None
        self.p: H = None
        self.o: G = None
        self.q: E = None
        self.w: E = None
        self.x: I = None
        self.v: J = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: B = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: D = None
        self.x: J = None
        self.t: A = None
        self.w: C = None
        self.s: J = None
        self.r: H = None
        self.y: J = None
        self.o: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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