class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: I = None
        self.t: I = None
        self.z: G = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: H = None
        self.o: C = None
        self.t: A = None
        self.w: J = None
        self.y: J = None
        self.u: I = None
        self.z: A = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: F = None
        self.t: E = None
        self.z: E = None
        self.o: G = None
        self.w: D = None
        self.s: J = None
        self.r: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: I = None
        self.t: I = None
        self.z: G = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: H = None
        self.o: C = None
        self.t: A = None
        self.w: J = None
        self.y: J = None
        self.u: I = None
        self.z: A = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: F = None
        self.t: E = None
        self.z: E = None
        self.o: G = None
        self.w: D = None
        self.s: J = None
        self.r: C = None
        self.txt = txt

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

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

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