//#define NDEBUG
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <iostream>
#include <vector>

namespace n91 {

  using i8 = std::int_fast8_t;
  using i32 = std::int_fast32_t;
  using i64 = std::int_fast64_t;
  using u8 = std::uint_fast8_t;
  using u32 = std::uint_fast32_t;
  using u64 = std::uint_fast64_t;
  using isize = std::ptrdiff_t;
  using usize = std::size_t;

  struct rep {
    struct itr {
      usize i;
      constexpr itr(const usize i) noexcept : i(i) {}
      void operator++() noexcept { ++i; }
      constexpr usize operator*() const noexcept { return i; }
      constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
    };
    const itr f, l;
    constexpr rep(const usize f, const usize l) noexcept
      : f(std::min(f, l)), l(l) {}
    constexpr auto begin() const noexcept { return f; }
    constexpr auto end() const noexcept { return l; }
  };
  struct revrep {
    struct itr {
      usize i;
      constexpr itr(const usize i) noexcept : i(i) {}
      void operator++() noexcept { --i; }
      constexpr usize operator*() const noexcept { return i; }
      constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
    };
    const itr f, l;
    constexpr revrep(const usize f, const usize l) noexcept
      : f(l - 1), l(std::min(f, l) - 1) {}
    constexpr auto begin() const noexcept { return f; }
    constexpr auto end() const noexcept { return l; }
  };
  template <class T> auto md_vec(const usize n, const T& value) {
    return std::vector<T>(n, value);
  }
  template <class... Args> auto md_vec(const usize n, Args... args) {
    return std::vector<decltype(md_vec(args...))>(n, md_vec(args...));
  }
  template <class T> constexpr T difference(const T& a, const T& b) noexcept {
    return a < b ? b - a : a - b;
  }
  template <class T> void chmin(T& a, const T& b) noexcept {
    if (b < a)
      a = b;
  }
  template <class T> void chmax(T& a, const T& b) noexcept {
    if (a < b)
      a = b;
  }
  template <class T> T scan() {
    T ret;
    std::cin >> ret;
    return ret;
  }

} // namespace n91
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <vector>

namespace n91 {

  using usize = std::size_t;
  using u64 = std::uint_fast64_t;

  template <u64 Modulus, u64 PrimitiveRoot> void ntt(std::vector<u64>& a) {
    const usize size = a.size();
    const usize m = size - 1;
    std::vector<u64> b(size);
    u64 root = 1;
    {
      u64 base = PrimitiveRoot;
      u64 exp = (Modulus - 1) / size;
      while (exp != 0) {
        if (exp % 2 != 0) {
          root = root * base % Modulus;
        }
        exp /= 2;
        base = base * base % Modulus;
      }
    }
    for (usize i = size; (i /= 2) != 0;) {
      std::swap(a, b);
      u64 c = 1;
      u64 d = root;
      for (usize j = 1; j != i; j *= 2) {
        d = d * d % Modulus;
      }
      for (usize j = 0; j != size; j += i) {
        const usize l = j * 2 & m, r = l + i;
        for (usize k = 0; k != i; ++k) {
          a[j + k] = (b[l + k] + b[r + k] * c) % Modulus;
        }
        c = c * d % Modulus;
      }
    }
  }

  template <u64 Modulus, u64 PrimitiveRoot> void inv_ntt(std::vector<u64>& a) {
    ntt<Modulus, PrimitiveRoot>(a);
    std::reverse(a.begin() + 1, a.end());
    const u64 inv = Modulus - (Modulus - 1) / a.size();
    for (auto& e : a) {
      e = e * inv % Modulus;
    }
  }

} // namespace n91

#include <cstdint>

template <std::uint_fast64_t mod> class modint {
  using u64 = std::uint_fast64_t;

public:
  u64 v;

  constexpr modint(const u64 x = 0) noexcept : v(x% mod) {}
  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 modint& operator+=(const modint rhs) noexcept {
    v += rhs.v;
    if (v >= mod)
      v -= mod;
    return *this;
  }
  constexpr modint& operator-=(const modint rhs) noexcept {
    if (v < rhs.v)
      v += mod;
    v -= rhs.v;
    return *this;
  }
  constexpr modint& operator*=(const modint rhs) noexcept {
    v = v * rhs.v % mod;
    return *this;
  }
  constexpr modint& operator/=(modint rhs) noexcept {
    u64 exp = mod - 2;
    while (exp != 0) {
      if (exp % 2 != 0)
        *this *= rhs;
      rhs *= rhs;
      exp /= 2;
    }
    return *this;
  }
};

#include <algorithm>
#include <chrono>
#include <iostream>
#include <random>
#include <utility>

namespace n91 {

  u64 find_primroot(const u64 p) {
    std::vector<u64> factor;
    {
      u64 q = p - 1;
      for (u64 i = 2; i * i <= q; i += 1) {
        if (q % i == 0) {
          factor.push_back(i);
          do {
            q /= i;
          } while (q % i == 0);
        }
      }
      if (q != 1) {
        factor.push_back(q);
      }
    }
    for (u64& e : factor) {
      e = (p - 1) / e;
    }
    for (u64 cand = 1;; cand += 1) {
      if (std::none_of(factor.cbegin(), factor.cend(), [&](u64 exp) {
        u64 base = cand;
        u64 a = 1;
        while (exp != 0) {
          if (exp % 2 == 1) {
            a = a * base % p;
          }
          base = base * base % p;
          exp /= 2;
        }
        return a == 1;
        })) {
        return cand;
      }
    }
  }

  void main_() {
    //*
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    //*/
    const u64 p = 200003;
    u64 ans = 0;
    const u64 proot = find_primroot(p);
    const usize n = scan<usize>();
    std::vector<u64> A(p);
    {
      for (const usize i : rep(0, n)) {
        const u64 a = scan<u64>();
        if (a != 0) {
          A[a] += 1;
          ans -= (a * a) % p;
        }
      }
    }
    const usize s = [&]() {
      usize s = 1;
      while (s < p - 1) {
        s *= 2;
      }
      return s * 2;
    }();
    std::vector<u64> a(s);
    {
      u64 t = 1;
      for (const usize i : rep(0, p - 1)) {
        a[i] = A[t];
        t = t * proot % p;
      }
    }
    auto b = a;
    static constexpr u64 P1 = 998244353;
    static constexpr u64 PR1 = 3;
    static constexpr u64 P2 = 469762049;
    static constexpr u64 PR2 = 3;
    ntt<P1, PR1>(a);
    ntt<P2, PR2>(b);
    std::vector<u64> c(s), d(s);
    for (const usize i : rep(0, s)) {
      c[i] = a[i] * a[i] % P1;
      d[i] = b[i] * b[i] % P2;
    }
    inv_ntt<P1, PR1>(c);
    inv_ntt<P2, PR2>(d);
    for (const usize i : rep(p - 1, s)) {
      c[i % (p - 1)] = (c[i % (p - 1)] + c[i]) % P1;
      d[i % (p - 1)] = (d[i % (p - 1)] + d[i]) % P2;
    }
    std::vector<u64> C(p), D(p);
    {
      u64 t = 1;
      for (const usize i : rep(0, p - 1)) {
        C[t] = c[i];
        D[t] = d[i];
        t = t * proot % p;
      }
    }
    for (const usize i : rep(1, p)) {
      using mint = modint<P1>;
      const u64 y = ((mint(C[i]) - mint(D[i])) / mint(P2)).v;
      const u64 x = y * P2 + D[i];
      ans += x * i;
    }
    ans /= 2;

    std::cout << ans << std::endl;
  }

} // namespace n91

int main() {
  n91::main_();
  return 0;
}

Measured memory_bytes: 25248