import sys

import numpy as np



def fft_convolve(f, g):

    """

    数列 (多項式) f, g の畳み込みの計算．上下 15 bitずつ分けて計算することで，

    30 bit以下の整数，長さ 250000 程度の数列での計算が正確に行える．

    """

    fft = np.fft.rfft

    ifft = np.fft.irfft

    Lf = len(f)

    Lg = len(g)

    L = Lf + Lg - 1

    fft_len = 1 << L.bit_length()

    fl = f & (1 << 15) - 1

    fh = f >> 15

    gl = g & (1 << 15) - 1

    gh = g >> 15



    def conv(f, g):

        return ifft(fft(f, fft_len) * fft(g, fft_len))[:L]



    x = conv(fl, gl)

    y = conv(fl + fh, gl + gh)

    z = conv(fh, gh)

    a, b, c = [(x + .5).astype(np.int64) for x in [x, y, z]]

    return (a + ((b - a - c) << 15) + (c << 30))





ROOT=2

P=200003

pw=[1]*(P-1)

lg=[-1]*P



for i in range(1,len(pw)):

    pw[i]=ROOT*pw[i-1]%P

for i in range(len(pw)):

    lg[pw[i]]=i



N=int(eval(input()))

A=np.array([int(x) for x in input().split()],dtype=np.int64)

B=[0]*P

for a in A:

    if a==0:

        continue

    B[lg[a]]+=1

B=np.array(B,dtype=np.int64)

C=fft_convolve(B,B)

for i in range(P-1,len(C)):

    C[i%(P-1)]+=C[i]

C=C[:P-1]



ans=0

for i in range(len(B)):

    C[2*i%(P-1)]-=B[i]*B[i]

    ans+=B[i]*(B[i]-1)//2*pw[2*i%(P-1)]

for i in range(len(C)):

    C[i]//=2



for i in range(len(C)):

    ans+=pw[i]*C[i]



print(ans)
import sys

import numpy as np



def fft_convolve(f, g):

    """

    数列 (多項式) f, g の畳み込みの計算．上下 15 bitずつ分けて計算することで，

    30 bit以下の整数，長さ 250000 程度の数列での計算が正確に行える．

    """

    fft = np.fft.rfft

    ifft = np.fft.irfft

    Lf = len(f)

    Lg = len(g)

    L = Lf + Lg - 1

    fft_len = 1 << L.bit_length()

    fl = f & (1 << 15) - 1

    fh = f >> 15

    gl = g & (1 << 15) - 1

    gh = g >> 15



    def conv(f, g):

        return ifft(fft(f, fft_len) * fft(g, fft_len))[:L]



    x = conv(fl, gl)

    y = conv(fl + fh, gl + gh)

    z = conv(fh, gh)

    a, b, c = [(x + .5).astype(np.int64) for x in [x, y, z]]

    return (a + ((b - a - c) << 15) + (c << 30))





ROOT=2

P=200003

pw=[1]*(P-1)

lg=[-1]*P



for i in range(1,len(pw)):

    pw[i]=ROOT*pw[i-1]%P

for i in range(len(pw)):

    lg[pw[i]]=i



N=int(eval(input()))

A=np.array([int(x) for x in input().split()],dtype=np.int64)

B=[0]*P

for a in A:

    if a==0:

        continue

    B[lg[a]]+=1

B=np.array(B,dtype=np.int64)

C=fft_convolve(B,B)

ans=0

for a in A:

    ans-=a*a%P

for i in range(len(C)):

    ans+=C[i]*pw[i%(P-1)]

ans//=2

print(ans)

import sys
import numpy as np


def fft_convolve(f, g):
    """
    数列 (多項式) f, g の畳み込みの計算．上下 15 bitずつ分けて計算することで，
    30 bit以下の整数，長さ 250000 程度の数列での計算が正確に行える．
    """
    fft = np.fft.rfft
    ifft = np.fft.irfft
    Lf = len(f)
    Lg = len(g)
    L = Lf + Lg - 1
    fft_len = 1 << L.bit_length()
    fl = f & (1 << 15) - 1
    fh = f >> 15
    gl = g & (1 << 15) - 1
    gh = g >> 15

    def conv(f, g):
        return ifft(fft(f, fft_len) * fft(g, fft_len))[:L]

    x = conv(fl, gl)
    y = conv(fl + fh, gl + gh)
    z = conv(fh, gh)
    a, b, c = [(x + 0.5).astype(np.int64) for x in [x, y, z]]
    return a + ((b - a - c) << 15) + (c << 30)


ROOT = 2
P = 200003
pw = [1] * (P - 1)
lg = [-1] * P
for i in range(1, len(pw)):
    pw[i] = ROOT * pw[i - 1] % P
for i in range(len(pw)):
    lg[pw[i]] = i
N = int(eval(input()))
A = np.array([int(x) for x in input().split()], dtype=np.int64)
B = [0] * P
for a in A:
    if a == 0:
        continue
    B[lg[a]] += 1
B = np.array(B, dtype=np.int64)
C = fft_convolve(B, B)
for i in range(P - 1, len(C)):
    C[i % (P - 1)] += C[i]
C = C[: P - 1]
ans = 0
for i in range(len(B)):
    C[2 * i % (P - 1)] -= B[i] * B[i]
    ans += B[i] * (B[i] - 1) // 2 * pw[2 * i % (P - 1)]
for i in range(len(C)):
    C[i] //= 2
for i in range(len(C)):
    ans += pw[i] * C[i]
print(ans)

import sys
import numpy as np


def fft_convolve(f, g):
    """
    数列 (多項式) f, g の畳み込みの計算．上下 15 bitずつ分けて計算することで，
    30 bit以下の整数，長さ 250000 程度の数列での計算が正確に行える．
    """
    fft = np.fft.rfft
    ifft = np.fft.irfft
    Lf = len(f)
    Lg = len(g)
    L = Lf + Lg - 1
    fft_len = 1 << L.bit_length()
    fl = f & (1 << 15) - 1
    fh = f >> 15
    gl = g & (1 << 15) - 1
    gh = g >> 15

    def conv(f, g):
        return ifft(fft(f, fft_len) * fft(g, fft_len))[:L]

    x = conv(fl, gl)
    y = conv(fl + fh, gl + gh)
    z = conv(fh, gh)
    a, b, c = [(x + 0.5).astype(np.int64) for x in [x, y, z]]
    return a + ((b - a - c) << 15) + (c << 30)


ROOT = 2
P = 200003
pw = [1] * (P - 1)
lg = [-1] * P
for i in range(1, len(pw)):
    pw[i] = ROOT * pw[i - 1] % P
for i in range(len(pw)):
    lg[pw[i]] = i
N = int(eval(input()))
A = np.array([int(x) for x in input().split()], dtype=np.int64)
B = [0] * P
for a in A:
    if a == 0:
        continue
    B[lg[a]] += 1
B = np.array(B, dtype=np.int64)
C = fft_convolve(B, B)
ans = 0
for a in A:
    ans -= a * a % P
for i in range(len(C)):
    ans += C[i] * pw[i % (P - 1)]
ans //= 2
print(ans)

-for i in range(P - 1, len(C)): -    C[i % (P - 1)] += C[i] -C = C[: P - 1] -for i in range(len(B)): -    C[2 * i % (P - 1)] -= B[i] * B[i] -    ans += B[i] * (B[i] - 1) // 2 * pw[2 * i % (P - 1)] +for a in A: +    ans -= a * a % P -    C[i] //= 2 -for i in range(len(C)): -    ans += pw[i] * C[i] +    ans += C[i] * pw[i % (P - 1)] +ans //= 2