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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: H = None
        self.p: E = None
        self.y: F = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.z: I = None
        self.t: E = None
        self.w: F = None
        self.v: G = None
        self.s: F = None
        self.p: C = None
        self.o: F = None
        self.u: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: F = None
        self.y: H = None
        self.o: C = None
        self.w: F = None
        self.q: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: H = None
        self.p: E = None
        self.y: F = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.z: I = None
        self.t: E = None
        self.w: F = None
        self.v: G = None
        self.s: F = None
        self.p: C = None
        self.o: F = None
        self.u: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: F = None
        self.y: H = None
        self.o: C = None
        self.w: F = None
        self.q: A = None
        self.txt = txt

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

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