class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: J = None
        self.t: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: J = None
        self.w: B = None
        self.u: C = None
        self.x: F = None
        self.r: H = None
        self.v: J = None
        self.p: J = None
        self.z: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: G = None
        self.x: A = None
        self.u: A = None
        self.o: G = None
        self.t: H = None
        self.z: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: J = None
        self.w: B = None
        self.u: C = None
        self.x: F = None
        self.r: H = None
        self.v: J = None
        self.p: J = None
        self.z: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: G = None
        self.x: A = None
        self.u: A = None
        self.o: G = None
        self.t: H = None
        self.z: H = None
        self.txt = txt

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

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

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

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

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

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