#line 1 "atcoder-workspace/agc047/c/c.cpp"
#ifdef LOCAL
    #define _GLIBCXX_DEBUG
#else
    #pragma GCC optimize("O3")
    #pragma GCC target("avx,avx2")
    #pragma GCC optimize("unroll-loops")
#endif
// #define NDEBUG

#include <bits/stdc++.h>
#include <ext/rope>

#line 4 "Library/config.hpp"
namespace config
{
    const auto start_time{std::chrono::system_clock::now()};
    int64_t elapsed()
    {
        using namespace std::chrono;
        const auto end_time{system_clock::now()};
        return duration_cast<milliseconds>(end_time - start_time).count();
    }
    __attribute__((constructor)) void setup()
    {
        using namespace std;
        ios::sync_with_stdio(false);
        cin.tie(nullptr);
        cout << fixed << setprecision(15);
        #ifdef _buffer_check
            atexit([]{ ofstream cnsl("CON"); char bufc; if(cin >> bufc) cnsl << "\n\033[1;35mwarning\033[0m: buffer not empty.\n\n"; });
        #endif
    }
    unsigned cases(void);
    template <class C> void main() { for(unsigned t = cases(); t; --t) C(); }
}
struct solver; int main() { config::main<solver>(); }
#line 2 "Library/utils/iostream_overload.hpp"
namespace std
{
    template <class T, class U> istream &operator>>(istream &is, pair<T, U> &p) { return is >> p.first >> p.second; }
    template <class T, class U> ostream &operator<<(ostream &os, const pair<T, U> &p) { return os << p.first << ' ' << p.second; }
    template <class tuple_t, size_t index> struct tupleis { static istream &apply(istream &is, tuple_t &t) { tupleis<tuple_t, index - 1>::apply(is, t); return is >> get<index>(t); } };
    template <class tuple_t> struct tupleis<tuple_t, SIZE_MAX> { static istream &apply(istream &is, tuple_t &t) { return is; } };
    template <class... T> istream &operator>>(istream &is, tuple<T...> &t) { return tupleis<tuple<T...>, tuple_size<tuple<T...>>::value - 1>::apply(is, t); }
    template <> istream &operator>>(istream &is, tuple<> &t) { return is; }
    template <class tuple_t, size_t index> struct tupleos { static ostream &apply(ostream &os, const tuple_t &t) { tupleos<tuple_t, index - 1>::apply(os, t); return os << ' ' << get<index>(t); } };
    template <class tuple_t> struct tupleos<tuple_t, 0> { static ostream &apply(ostream &os, const tuple_t &t) { return os << get<0>(t); } };
    template <class... T> ostream &operator<<(ostream &os, const tuple<T...> &t) { return tupleos<tuple<T...>, tuple_size<tuple<T...>>::value - 1>::apply(os, t); }
    template <> ostream &operator<<(ostream &os, const tuple<> &t) { return os; }
    template <class Container, typename Value = typename Container::value_type, enable_if_t<!is_same<decay_t<Container>, string>::value, nullptr_t> = nullptr>
    istream& operator>>(istream& is, Container &cont) { for(auto&& e : cont) is >> e; return is; }
    template <class Container, typename Value = typename Container::value_type, enable_if_t<!is_same<decay_t<Container>, string>::value, nullptr_t> = nullptr>
    ostream& operator<<(ostream& os, const Container &cont) { bool flag = 1; for(auto&& e : cont) flag ? flag = 0 : (os << ' ', 0), os << e; return os; }
}
#line 1 "Library/utils/fixed_point.hpp"
template <class lambda_type>
class fixed_point
{
    lambda_type func;
public:
    fixed_point(lambda_type &&f) : func(std::move(f)) {}
    template <class... Args> auto operator()(Args &&... args) const { return func(*this, std::forward<Args>(args)...); }
};
#line 2 "Library/utils/read.hpp"
// read with std::cin.
template <class T = void>
struct read
{
    typename std::remove_const<T>::type value;
    template <class... types>
    read(types... args) : value(args...) { std::cin >> value; }
    operator T() const { return value; }
};
template <>
struct read<void>
{
    template <class T>
    operator T() const { T value; std::cin >> value; return value; }
};
#line 2 "Library/utils/chval.hpp"
template <class T, class Comp = std::less<T>> bool chle(T &x, const T &y, Comp comp = Comp()) { return comp(y, x) ? x = y, true : false; }
template <class T, class Comp = std::less<T>> bool chge(T &x, const T &y, Comp comp = Comp()) { return comp(x, y) ? x = y, true : false; }
#line 1 "Library/utils/binary_search.hpp"
// binary search on discrete range.
template <class iter_type, class pred_type>
iter_type binary(iter_type ok, iter_type ng, pred_type pred)
{
    assert(ok != ng);
    long long dist(ng - ok);
    while(std::abs(dist) > 1)
    {
        iter_type mid(ok + dist / 2);
        if(pred(mid)) ok = mid, dist -= dist / 2;
        else ng = mid, dist /= 2;
    }
    return ok;
}
// binary search on real numbers.
template <class pred_type>
long double binary(long double ok, long double ng, const long double eps, pred_type pred)
{
    assert(ok != ng);
    while(std::abs(ok - ng) > eps)
    {
        long double mid{(ok + ng) / 2};
        (pred(mid) ? ok : ng) = mid;
    }
    return ok;
}
#line 4 "Library/modulus/compile-time/modint.hpp"
template <int_fast64_t mod>
struct modint
{
    using value_type = int_fast64_t;
    static constexpr modint one() noexcept { return 1; }
    constexpr modint() noexcept : val(0) {}
    template <class int_type, std::enable_if_t<std::is_integral<int_type>::value, std::nullptr_t> = nullptr>
    constexpr modint(int_type _val) noexcept : val((_val %= mod) < 0 ? mod + _val : _val) {}
    constexpr value_type value() const noexcept { return val; }
    constexpr modint operator++(int) noexcept { modint t{*this}; return operator+=(1), t; }
    constexpr modint operator--(int) noexcept { modint t{*this}; return operator-=(1), t; }
    constexpr modint &operator++() noexcept { return operator+=(1); }
    constexpr modint &operator--() noexcept { return operator-=(1); }
    constexpr modint operator-() const noexcept { return modint(-val); }
    constexpr modint &operator+=(const modint &rhs) noexcept { return (val += rhs.val) < mod ? 0 : val -= mod, *this; }
    constexpr modint &operator-=(const modint &rhs) noexcept { return (val += mod - rhs.val) < mod ? 0 : val -= mod, *this; }
    constexpr modint &operator*=(const modint &rhs) noexcept { return val = val * rhs.val % mod, *this; }
    constexpr modint &operator/=(const modint &rhs) noexcept { return *this *= inverse(rhs); }
    constexpr modint operator+(const modint &rhs) const noexcept { return modint(*this) += rhs; }
    constexpr modint operator-(const modint &rhs) const noexcept { return modint(*this) -= rhs; }
    constexpr modint operator*(const modint &rhs) const noexcept { return modint(*this) *= rhs; }
    constexpr modint operator/(const modint &rhs) const noexcept { return modint(*this) /= rhs; }
    constexpr bool operator==(const modint &rhs) const noexcept { return val == rhs.val; }
    constexpr bool operator!=(const modint &rhs) const noexcept { return val != rhs.val; }
    constexpr bool operator!() const noexcept { return !val; }
    friend constexpr modint operator+(value_type lhs, modint rhs) noexcept { return modint(lhs) + rhs; }
    friend constexpr modint operator-(value_type lhs, modint rhs) noexcept { return modint(lhs) - rhs; }
    friend constexpr modint operator*(value_type lhs, modint rhs) noexcept { return modint(lhs) * rhs; }
    friend constexpr modint operator/(value_type lhs, modint rhs) noexcept { return modint(lhs) / rhs; }
    static constexpr modint inverse(const modint &rhs) noexcept
    {
        assert(rhs != 0);
        value_type a{mod}, b{rhs.val}, u{}, v{1}, t{};
        while(b) t = a / b, a ^= b ^= (a -= t * b) ^= b, u ^= v ^= (u -= t * v) ^= v;
        return {u};
    }
    static constexpr modint pow(modint rhs, int_fast64_t e) noexcept
    {
        if(e < 0) e = e % (mod - 1) + mod - 1;
        modint res{1};
        while(e) { if(e & 1) res *= rhs; rhs *= rhs, e >>= 1; }
        return res;
    }
    friend std::ostream &operator<<(std::ostream &os, const modint &rhs) noexcept { return os << rhs.val; }
    friend std::istream &operator>>(std::istream &is, modint &rhs) noexcept { value_type val; rhs = (is >> val, val); return is; }
protected:
    value_type val;
}; // class modint
// specialization for modulo 2.
template <>
class modint<2>
{
    bool val;
public:
    static constexpr modint one() noexcept { return 1; }
    constexpr modint() noexcept : val(false) {}
    template <class int_type, std::enable_if_t<std::is_integral<int_type>::value, std::nullptr_t> = nullptr>
    constexpr modint(int_type _val) noexcept : val(_val & 1) {}
    constexpr operator bool() const noexcept { return val; }
    constexpr bool value() const noexcept { return val; }
    constexpr modint &operator+=(const modint &rhs) noexcept { return val ^= rhs.val, *this; }
    constexpr modint &operator-=(const modint &rhs) noexcept { return val ^= rhs.val, *this; }
    constexpr modint &operator*=(const modint &rhs) noexcept { return val &= rhs.val, *this; }
    constexpr modint &operator/=(const modint &rhs) noexcept { assert(rhs.val); return *this; }
    constexpr modint operator!() const noexcept { return !val; }
    constexpr modint operator-() const noexcept { return *this; }
    constexpr modint operator+(const modint &rhs) const noexcept { return val != rhs.val; }
    constexpr modint operator-(const modint &rhs) const noexcept { return val != rhs.val; }
    constexpr modint operator*(const modint &rhs) const noexcept { return val && rhs.val; }
    constexpr modint operator/(const modint &rhs) const noexcept { assert(rhs.val); return *this; }
    constexpr bool operator==(const modint &rhs) const noexcept { return val == rhs.val; }
    constexpr bool operator!=(const modint &rhs) const noexcept { return val != rhs.val; }
    friend constexpr modint operator+(long long lhs, modint rhs) noexcept { return lhs & 1 ? !rhs : rhs; }
    friend constexpr modint operator-(long long lhs, modint rhs) noexcept { return lhs & 1 ? !rhs : rhs; }
    friend constexpr modint operator*(long long lhs, modint rhs) noexcept { return lhs & 1 ? rhs : modint<2>{0}; }
    friend constexpr modint operator/(long long lhs, modint rhs) noexcept { assert(rhs.val); return lhs & 1 ? rhs : modint<2>{0}; }
    friend std::ostream &operator<<(std::ostream &os, const modint &rhs) noexcept { return os << rhs.val; }
    friend std::istream &operator>>(std::istream &is, modint &rhs) noexcept { long long val; rhs.val = (is >> val, val & 1); return is; }
}; // class modint<2>
#line 1 "Library/algebra/convolution/fast_Fourier_transform.hpp"



#line 9 "Library/algebra/convolution/fast_Fourier_transform.hpp"

namespace fast_Fourier_transform
{
    using real_t = double;

    class cmplx_t
    {
        real_t re, im;
        friend constexpr cmplx_t conj(cmplx_t x) { return x.im = -x.im, x; }
        friend std::istream &operator>>(std::istream &s, cmplx_t &x) { return s >> x.re >> x.im; }
        friend std::ostream &operator<<(std::ostream &s, const cmplx_t &x) { return s << x.re << ' ' << x.im; }
      public:
        constexpr cmplx_t() : re{real_t{}}, im{real_t{}} {}
        constexpr cmplx_t(real_t _re) : re{_re}, im{real_t{}} {}
        constexpr cmplx_t(real_t _re, real_t _im) : re{_re}, im{_im} {}
        constexpr cmplx_t(std::complex<real_t> x) : re{x.real()}, im{x.imag()} {}
        constexpr real_t real() const { return re; }
        constexpr void real(const real_t _re) { re = _re; }
        constexpr real_t imag() const { return im; }
        constexpr void imag(const real_t _im) { im = _im; }
        constexpr cmplx_t operator-() const { return cmplx_t(-re, -im); }
        constexpr cmplx_t &operator+=(const cmplx_t &x) { return re += x.re, im += x.im, *this; }
        constexpr cmplx_t &operator-=(const cmplx_t &x) { return *this += -x; }
        constexpr cmplx_t &operator*=(const cmplx_t &x) { real_t _re{re * x.re - im * x.im}; return im = im * x.re + x.im * re, re = _re, *this; }
        constexpr cmplx_t &operator*=(real_t x) { return re *= x, im *= x, *this; }
        constexpr cmplx_t &operator/=(const cmplx_t &x) { return conj(*this) /= re * re + im * im; }
        constexpr cmplx_t &operator/=(real_t x) { return re /= x, im /= x, *this; }
        constexpr cmplx_t operator+(const cmplx_t &x) const { return cmplx_t(*this) += x; }
        constexpr cmplx_t operator-(const cmplx_t &x) const { return cmplx_t(*this) -= x; }
        constexpr cmplx_t operator*(const cmplx_t &x) const { return cmplx_t(*this) *= x; }
        constexpr cmplx_t operator*(real_t x) const { return cmplx_t(*this) *= x; }
        constexpr cmplx_t operator/(const cmplx_t &x) const { return cmplx_t(*this) /= x; }
        constexpr cmplx_t operator/(real_t x) const { return cmplx_t(*this) /= x; }
    };

    using poly_t = std::vector<cmplx_t>;

    void discrete_Fourier_transform(poly_t &f)
    {
        const size_t n{f.size()}, mask{n - 1};
        assert(__builtin_popcount(n) == 1); // degree of f must be a power of two.
        static poly_t g; g.resize(n);
        constexpr cmplx_t zeta[31] =
        {
            {1, 0}, {-1, 0}, {0, 1},
            {0.70710678118654752438189403651, 0.70710678118654752443610414514},
            {0.92387953251128675610142140795, 0.38268343236508977172325753068},
            {0.98078528040323044911909938781, 0.19509032201612826785692544201},
            {0.99518472667219688623102546998, 0.09801714032956060199569840382},
            {0.99879545620517239270077028412, 0.04906767432741801425693899119},
            {0.99969881869620422009748220149, 0.02454122852291228803212346128},
            {0.99992470183914454093764001552, 0.01227153828571992607945510345},
            {0.99998117528260114264494415325, 0.00613588464915447535972750246},
            {0.99999529380957617150137498041, 0.00306795676296597627029751672},
            {0.99999882345170190993313003025, 0.00153398018628476561237225788},
            {0.99999970586288221914474799723, 0.00076699031874270452695124765},
            {0.99999992646571785113833452651, 0.00038349518757139558906815188},
            {0.99999998161642929381167504976, 0.00019174759731070330743679009},
            {0.99999999540410731290905263501, 0.00009587379909597734587360460},
            {0.99999999885102682753608427379, 0.00004793689960306688454884772},
            {0.99999999971275670682981095982, 0.00002396844980841821872882467},
            {0.99999999992818917670745273995, 0.00001198422490506970642183282},
            {0.99999999998204729416331065783, 0.00000599211245264242784278378},
            {0.99999999999551182356793271877, 0.00000299605622633466075058210},
            {0.99999999999887795586487812538, 0.00000149802811316901122883643},
            {0.99999999999971948897977205850, 0.00000074901405658471572113723},
            {0.99999999999992987223139048746, 0.00000037450702829238412391495},
            {0.99999999999998246807140014902, 0.00000018725351414619534486931},
            {0.99999999999999561700429751010, 0.00000009362675707309808280024},
            {0.99999999999999890425107437752, 0.00000004681337853654909269501},
            {0.99999999999999972607632112153, 0.00000002340668926827455275977},
            {0.99999999999999993153263280754, 0.00000001170334463413727718121},
            {0.99999999999999998286960567472, 0.00000000585167231706863869077}
        };
        for(size_t i{n >> 1}, ii{1}; i; i >>= 1, ++ii, swap(f, g))
        {
            cmplx_t powzeta{1};
            for(size_t j{}; j != n; powzeta *= zeta[ii])
                for(size_t k{}, x{mask & j << 1}, y{mask & (i + (j << 1))}; k != i; ++k, ++j, ++x, ++y)
                    g[j] = f[x] + powzeta * f[y];
        }
    }

    void inverse_discrete_Fourier_transform(poly_t &f) { discrete_Fourier_transform(f), reverse(next(f.begin()), f.end()); for(cmplx_t &e : f) e /= f.size(); }

    poly_t convolute(poly_t f, poly_t g)
    {
        if(f.empty() || g.empty()) return poly_t();
        const size_t deg_f{f.size() - 1}, deg_g{g.size() - 1}, deg_h{deg_f + deg_g}, n(1u << (32 - __builtin_clz(deg_h)));
        static poly_t h;
        f.resize(n, 0), g.resize(n, 0), h.resize(n);
        discrete_Fourier_transform(f), discrete_Fourier_transform(g);
        for(size_t i{}; i < n; ++i) h[i] = f[i] * g[i];
        inverse_discrete_Fourier_transform(h); h.resize(deg_h + 1);
        return h;
    }

    std::vector<real_t> convolute(const std::vector<real_t> &f, const std::vector<real_t> &g)
    {
        if(f.empty() || g.empty()) return std::vector<real_t>();
        const size_t deg_f{f.size() - 1}, deg_g{g.size() - 1}, deg_h{deg_f + deg_g}, n(1u << (32 - __builtin_clz(deg_h)));
        static std::vector<real_t> h; h.resize(deg_h + 1);
        static poly_t p; p.assign(n, 0);
        for(size_t i{}; i <= deg_f; ++i) p[i].real(f[i]);
        for(size_t i{}; i <= deg_g; ++i) p[i].imag(g[i]);
        discrete_Fourier_transform(p); // perform discrete Fourier transform on p = f + i*g.
        static poly_t q; q.resize(n);
        for(size_t i{}; i < n; ++i) { size_t j{i ? n - i : 0}; q[i] = (p[i] + conj(p[j])) * (p[i] - conj(p[j])); }
        inverse_discrete_Fourier_transform(q);
        for(size_t i{}; i <= deg_h; ++i) h[i] = q[i].imag() / 4;
        return h;
    }

    std::vector<int_least64_t> convolute(const std::vector<int_least64_t> &f, const std::vector<int_least64_t> &g)
    {
        if(f.empty() || g.empty()) return std::vector<int_least64_t>();
        const size_t deg_f{f.size() - 1}, deg_g{g.size() - 1}, deg_h{deg_f + deg_g}, n(1u << (32 - __builtin_clz(deg_h)));
        static std::vector<int_least64_t> h; h.resize(deg_h + 1);
        static poly_t p; p.assign(n, 0);
        for(size_t i{}; i <= deg_f; ++i) p[i].real(f[i]);
        for(size_t i{}; i <= deg_g; ++i) p[i].imag(g[i]);
        discrete_Fourier_transform(p); // perform discrete Fourier transform on p = f + i*g.
        static poly_t q; q.resize(n);
        for(size_t i{}; i < n; ++i) { size_t j{i ? n - i : 0}; q[i] = (p[i] + conj(p[j])) * (p[i] - conj(p[j])); }
        inverse_discrete_Fourier_transform(q);
        for(size_t i{}; i <= deg_h; ++i) h[i] = round(q[i].imag() / 4);
        return h;
    }

    std::vector<int_least32_t> convolute(const std::vector<int_least32_t> &f, const std::vector<int_least32_t> &g)
    {
        if(f.empty() || g.empty()) return std::vector<int_least32_t>();
        const size_t deg_f{f.size() - 1}, deg_g{g.size() - 1}, deg_h{deg_f + deg_g}, n(1u << (32 - __builtin_clz(deg_h)));
        static std::vector<int_least32_t> h; h.resize(deg_h + 1);
        static poly_t p; p.assign(n, 0);
        for(size_t i{}; i <= deg_f; ++i) p[i].real(f[i]);
        for(size_t i{}; i <= deg_g; ++i) p[i].imag(g[i]);
        discrete_Fourier_transform(p); // perform discrete Fourier transform on p = f + i*g.
        static poly_t q; q.resize(n);
        for(size_t i{}; i < n; ++i) { size_t j{i ? n - i : 0}; q[i] = (p[i] + conj(p[j])) * (p[i] - conj(p[j])); }
        inverse_discrete_Fourier_transform(q);
        for(size_t i{}; i <= deg_h; ++i) h[i] = round(q[i].imag() / 4);
        return h;
    }
} // namespace fast_Fourier_transform


#line 21 "atcoder-workspace/agc047/c/c.cpp"

#pragma region alias
using namespace std; using namespace __gnu_cxx;
using i32 = int_least32_t; using i64 = int_least64_t;
using p32 = pair<i32, i32>; using p64 = pair<i64, i64>;
template <class T, class Comp = less<T>> using heap = priority_queue<T, vector<T>, Comp>;
template <class T> using hashset = unordered_set<T>;
template <class Key, class Value> using hashmap = unordered_map<Key, Value>;
#pragma endregion

unsigned config::cases()
{
    unsigned t = 1;
    // t = -1;
    // cin >> t;
    return t;
}

using namespace fast_Fourier_transform;

struct solver
{
    const int mod=200003;
    using mint=modint<200003>;

    solver()
    {
        vector<i64> cnt(mod);
        int n=read();
        for(int i=0; i<n; i++)
        {
            int a=read();
            cnt[a]++;
        }
        vector<i64> pol(mod-1);
        {
            mint p=1;
            for(int i=0; i<mod-1; i++)
            {
                pol[i]=cnt[p.value()];
                p*=2;
            }
        }
        pol=convolute(pol,pol);
        pol.resize(mod*2);
        i64 ans=0;
        {
            mint p=1;
            for(int i=0; i<mod-1; i++)
            {
                i64 now=pol[i]+pol[i+mod-1];
                if(now!=0)
                {
                    ans+=now*p.value();
                }
                p*=2;
            }
        }
        // correction
        {
            for(i64 i=1; i<mod; i++)
            {
                i64 ii=i*i%mod;
                ans-=cnt[i]*ii;
            }
            ans/=2;
        }
        cout << ans << "\n";
    }
};


Measured memory_bytes: 38800