class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: F = None
        self.t: E = None
        self.u: B = None
        self.s: G = None
        self.w: D = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: J = None
        self.v: F = None
        self.q: D = None
        self.z: A = None
        self.u: I = None
        self.x: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: J = None
        self.t: I = None
        self.q: C = None
        self.s: B = None
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: G = None
        self.y: D = None
        self.t: G = None
        self.o: E = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: B = None
        self.s: A = None
        self.q: B = None
        self.o: B = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: C = None
        self.w: B = None
        self.u: F = None
        self.r: I = None
        self.v: F = None
        self.y: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: H = None
        self.s: I = None
        self.txt = txt

n = A("n")
m = B("m")
l = C("l")
b = D("b")
f = E("f")
h = F("h")
d = G("d")
j = H("j")
k = I("k")
e = J("e")

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

class B:
    def __init__(self, txt: str):
        self.o: J = None
        self.v: F = None
        self.q: D = None
        self.z: A = None
        self.u: I = None
        self.x: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: J = None
        self.t: I = None
        self.q: C = None
        self.s: B = None
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: G = None
        self.y: D = None
        self.t: G = None
        self.o: E = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: B = None
        self.s: A = None
        self.q: B = None
        self.o: B = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: C = None
        self.w: B = None
        self.u: F = None
        self.r: I = None
        self.v: F = None
        self.y: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: H = None
        self.s: I = None
        self.txt = txt

n = A("n")
m = B("m")
l = C("l")
b = D("b")
f = E("f")
h = F("h")
d = G("d")
j = H("j")
k = I("k")
e = J("e")

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