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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: G = None
        self.z: H = None
        self.q: I = None
        self.x: F = None
        self.t: H = None
        self.v: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: E = None
        self.w: F = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: B = None
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: G = None
        self.z: H = None
        self.q: I = None
        self.x: F = None
        self.t: H = None
        self.v: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: E = None
        self.w: F = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: B = None
        self.w: B = None
        self.txt = txt

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

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