class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: E = None
        self.t: I = None
        self.p: B = None
        self.x: E = None
        self.u: J = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: J = None
        self.o: A = None
        self.p: A = None
        self.q: A = None
        self.y: B = None
        self.x: E = None
        self.w: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.t: F = None
        self.q: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: E = None
        self.u: G = None
        self.y: E = None
        self.o: B = None
        self.p: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: E = None
        self.t: I = None
        self.p: B = None
        self.x: E = None
        self.u: J = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: J = None
        self.o: A = None
        self.p: A = None
        self.q: A = None
        self.y: B = None
        self.x: E = None
        self.w: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.t: F = None
        self.q: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: E = None
        self.u: G = None
        self.y: E = None
        self.o: B = None
        self.p: G = None
        self.txt = txt

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

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

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