class A:
    def __init__(self, txt: str):
        self.u: J = None
        self.v: G = None
        self.q: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: F = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: B = None
        self.r: J = None
        self.z: D = None
        self.y: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: F = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: F = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: B = None
        self.r: J = None
        self.z: D = None
        self.y: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: F = None
        self.u: E = None
        self.txt = txt

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

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

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

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