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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: H = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: J = None
        self.r: B = None
        self.u: H = None
        self.s: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: A = None
        self.v: E = None
        self.p: I = None
        self.s: I = None
        self.x: G = None
        self.w: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: B = None
        self.x: B = None
        self.w: B = None
        self.p: G = None
        self.y: A = None
        self.t: H = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: H = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: J = None
        self.r: B = None
        self.u: H = None
        self.s: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: A = None
        self.v: E = None
        self.p: I = None
        self.s: I = None
        self.x: G = None
        self.w: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: B = None
        self.x: B = None
        self.w: B = None
        self.p: G = None
        self.y: A = None
        self.t: H = None
        self.txt = txt

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

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

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