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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: E = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: J = None
        self.x: C = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: J = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: F = None
        self.r: J = None
        self.v: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: I = None
        self.t: A = None
        self.q: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: E = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: J = None
        self.x: C = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: J = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: F = None
        self.r: J = None
        self.v: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: I = None
        self.t: A = None
        self.q: E = None
        self.txt = txt

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

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