class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: D = None
        self.u: G = None
        self.r: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: H = None
        self.o: G = None
        self.z: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: F = None
        self.t: A = None
        self.q: D = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: B = None
        self.s: A = None
        self.z: H = None
        self.w: H = None
        self.o: J = None
        self.v: E = None
        self.p: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: J = None
        self.y: C = None
        self.w: H = None
        self.u: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: H = None
        self.o: G = None
        self.z: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: F = None
        self.t: A = None
        self.q: D = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: B = None
        self.s: A = None
        self.z: H = None
        self.w: H = None
        self.o: J = None
        self.v: E = None
        self.p: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: J = None
        self.y: C = None
        self.w: H = None
        self.u: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: B = None
        self.txt = txt

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

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