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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: J = None
        self.q: I = None
        self.v: E = None
        self.u: I = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: B = None
        self.q: F = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: I = None
        self.y: I = None
        self.z: C = None
        self.w: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: A = None
        self.w: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: I = None
        self.v: G = None
        self.t: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: J = None
        self.q: I = None
        self.v: E = None
        self.u: I = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: B = None
        self.q: F = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: I = None
        self.y: I = None
        self.z: C = None
        self.w: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: A = None
        self.w: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: I = None
        self.v: G = None
        self.t: D = None
        self.txt = txt

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

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