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

class B:
    def __init__(self, txt: str):
        self.q: J = None
        self.s: A = None
        self.w: H = None
        self.r: D = None
        self.y: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: A = None
        self.y: C = None
        self.z: F = None
        self.r: A = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: D = None
        self.u: E = None
        self.z: E = None
        self.y: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.x: I = None
        self.o: B = None
        self.y: G = None
        self.t: B = None
        self.w: C = None
        self.v: F = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: G = None
        self.z: J = None
        self.o: D = None
        self.s: F = None
        self.u: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: J = None
        self.s: A = None
        self.w: H = None
        self.r: D = None
        self.y: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: A = None
        self.y: C = None
        self.z: F = None
        self.r: A = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: D = None
        self.u: E = None
        self.z: E = None
        self.y: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.x: I = None
        self.o: B = None
        self.y: G = None
        self.t: B = None
        self.w: C = None
        self.v: F = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: G = None
        self.z: J = None
        self.o: D = None
        self.s: F = None
        self.u: D = None
        self.txt = txt

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

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

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