class A:
    def __init__(self, txt: str):
        self.s: I = None
        self.p: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: D = None
        self.r: H = None
        self.p: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: J = None
        self.p: J = None
        self.w: I = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: H = None
        self.o: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: F = None
        self.p: D = None
        self.z: A = None
        self.y: D = None
        self.r: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: D = None
        self.r: H = None
        self.p: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: J = None
        self.p: J = None
        self.w: I = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: H = None
        self.o: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: F = None
        self.p: D = None
        self.z: A = None
        self.y: D = None
        self.r: D = None
        self.txt = txt

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

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