class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: I = None
        self.w: D = None
        self.s: F = None
        self.z: C = None
        self.x: F = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: I = None
        self.q: A = None
        self.o: G = None
        self.s: H = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: C = None
        self.r: E = None
        self.x: C = None
        self.s: E = None
        self.y: H = None
        self.t: G = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: B = None
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: J = None
        self.w: H = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: E = None
        self.y: J = None
        self.q: G = None
        self.p: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: J = None
        self.q: D = None
        self.w: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: I = None
        self.w: D = None
        self.s: F = None
        self.z: C = None
        self.x: F = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: I = None
        self.q: A = None
        self.o: G = None
        self.s: H = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: C = None
        self.r: E = None
        self.x: C = None
        self.s: E = None
        self.y: H = None
        self.t: G = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: B = None
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: J = None
        self.w: H = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: E = None
        self.y: J = None
        self.q: G = None
        self.p: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: J = None
        self.q: D = None
        self.w: C = None
        self.txt = txt

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

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

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