class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: F = None
        self.t: F = None
        self.u: F = None
        self.x: H = None
        self.p: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: J = None
        self.v: A = None
        self.o: A = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: G = None
        self.w: B = None
        self.o: B = None
        self.u: G = None
        self.z: B = None
        self.p: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: A = None
        self.s: A = None
        self.z: D = None
        self.v: H = None
        self.q: I = None
        self.p: D = None
        self.x: D = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: A = None
        self.o: D = None
        self.q: G = None
        self.r: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: J = None
        self.v: A = None
        self.o: A = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: G = None
        self.w: B = None
        self.o: B = None
        self.u: G = None
        self.z: B = None
        self.p: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: A = None
        self.s: A = None
        self.z: D = None
        self.v: H = None
        self.q: I = None
        self.p: D = None
        self.x: D = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: A = None
        self.o: D = None
        self.q: G = None
        self.r: F = None
        self.txt = txt

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

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