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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: J = None
        self.w: C = None
        self.s: H = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: E = None
        self.r: J = None
        self.u: A = None
        self.s: C = None
        self.o: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: J = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: J = None
        self.w: C = None
        self.s: H = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: E = None
        self.r: J = None
        self.u: A = None
        self.s: C = None
        self.o: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: J = None
        self.txt = txt

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

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

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

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