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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: J = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: J = None
        self.v: B = None
        self.t: B = None
        self.z: B = None
        self.o: A = None
        self.q: E = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: B = None
        self.t: C = None
        self.w: E = None
        self.u: G = None
        self.v: I = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: I = None
        self.p: E = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: G = None
        self.r: G = None
        self.o: H = None
        self.w: F = None
        self.u: F = None
        self.x: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: J = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: J = None
        self.v: B = None
        self.t: B = None
        self.z: B = None
        self.o: A = None
        self.q: E = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: B = None
        self.t: C = None
        self.w: E = None
        self.u: G = None
        self.v: I = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: I = None
        self.p: E = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: G = None
        self.r: G = None
        self.o: H = None
        self.w: F = None
        self.u: F = None
        self.x: F = None
        self.txt = txt

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

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

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