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

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: G = None
        self.x: C = None
        self.y: J = None
        self.z: J = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.y: C = None
        self.q: E = None
        self.o: E = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.y: I = None
        self.s: B = None
        self.w: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: G = None
        self.x: C = None
        self.y: J = None
        self.z: J = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.y: C = None
        self.q: E = None
        self.o: E = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.y: I = None
        self.s: B = None
        self.w: E = None
        self.txt = txt

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

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