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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: J = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: H = None
        self.t: I = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: H = None
        self.x: C = None
        self.z: A = None
        self.o: I = None
        self.v: F = None
        self.y: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: F = None
        self.s: D = None
        self.y: B = None
        self.r: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: I = None
        self.o: A = None
        self.t: H = None
        self.s: B = None
        self.r: A = None
        self.z: E = None
        self.q: B = None
        self.w: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: J = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: H = None
        self.t: I = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: H = None
        self.x: C = None
        self.z: A = None
        self.o: I = None
        self.v: F = None
        self.y: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: F = None
        self.s: D = None
        self.y: B = None
        self.r: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: I = None
        self.o: A = None
        self.t: H = None
        self.s: B = None
        self.r: A = None
        self.z: E = None
        self.q: B = None
        self.w: E = None
        self.txt = txt

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

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