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

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

class C:
    def __init__(self, txt: str):
        self.o: I = None
        self.t: A = None
        self.r: J = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: J = None
        self.y: J = None
        self.t: I = None
        self.s: B = None
        self.r: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: J = None
        self.t: B = None
        self.s: D = None
        self.w: D = None
        self.p: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: C = None
        self.w: E = None
        self.u: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: C = None
        self.v: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: I = None
        self.t: A = None
        self.r: J = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: J = None
        self.y: J = None
        self.t: I = None
        self.s: B = None
        self.r: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: J = None
        self.t: B = None
        self.s: D = None
        self.w: D = None
        self.p: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: C = None
        self.w: E = None
        self.u: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: C = None
        self.v: C = None
        self.txt = txt

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

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

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