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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: J = None
        self.z: J = None
        self.p: D = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: H = None
        self.y: C = None
        self.q: C = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: E = None
        self.o: B = None
        self.z: G = None
        self.u: D = None
        self.q: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: J = None
        self.p: D = None
        self.x: C = None
        self.r: E = None
        self.t: E = None
        self.v: H = None
        self.y: H = None
        self.q: H = None
        self.o: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: J = None
        self.z: J = None
        self.p: D = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: H = None
        self.y: C = None
        self.q: C = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: E = None
        self.o: B = None
        self.z: G = None
        self.u: D = None
        self.q: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: J = None
        self.p: D = None
        self.x: C = None
        self.r: E = None
        self.t: E = None
        self.v: H = None
        self.y: H = None
        self.q: H = None
        self.o: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: C = None
        self.txt = txt

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

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