class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: C = None
        self.s: C = None
        self.z: G = None
        self.x: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: J = None
        self.q: B = None
        self.y: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: C = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: H = None
        self.p: J = None
        self.t: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: F = None
        self.w: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: A = None
        self.r: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: J = None
        self.q: B = None
        self.y: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: C = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: H = None
        self.p: J = None
        self.t: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: F = None
        self.w: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: A = None
        self.r: D = None
        self.txt = txt

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

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