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

class B:
    def __init__(self, txt: str):
        self.w: J = None
        self.s: I = None
        self.v: G = None
        self.t: D = None
        self.p: E = None
        self.u: F = None
        self.z: I = None
        self.o: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: C = None
        self.z: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: D = None
        self.s: G = None
        self.q: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: J = None
        self.s: I = None
        self.v: G = None
        self.t: D = None
        self.p: E = None
        self.u: F = None
        self.z: I = None
        self.o: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: C = None
        self.z: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: D = None
        self.s: G = None
        self.q: F = None
        self.txt = txt

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

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