#include <bits/stdc++.h>
using namespace std;
long long gi() {
  char cc = getchar();
  long long cn = 0, flus = 1;
  while (cc < '0' || cc > '9') {
    if (cc == '-') flus = -flus;
    cc = getchar();
  }
  while (cc >= '0' && cc <= '9') cn = cn * 10 + cc - '0', cc = getchar();
  return cn * flus;
}
const long long N = 1e6 + 5;
const long long P = 1e9 + 7;
const long long maxn = 1e6 + 5;
const long long M = 999999;
long long n, a[N], g[N], ans[N], fac[N];
struct node {
  long long f1, f2, f3;
  void init(long long x) { f3 = 1, f2 = x, f1 = x * x % P; }
} f[N];
node operator*(node x, node y) {
  return (node){
      (x.f1 * fac[y.f3] % P + x.f2 * y.f2 * 2 % P + fac[x.f3] * y.f1 % P) % P,
      (x.f2 * fac[y.f3] % P + y.f2 * fac[x.f3] % P) % P, x.f3 + y.f3};
}
signed main() {
  n = gi(), fac[0] = 1;
  for (register long long i = (1); i <= (n); ++i) fac[i] = fac[i - 1] * 2 % P;
  for (register long long i = (1); i <= (n); ++i) {
    a[i] = gi();
    node u;
    u.init(a[i]);
    f[a[i]] = f[a[i]] * u;
  }
  long long l = 1;
  for (register long long k = (0); k <= (5); ++k) {
    for (register long long i = (M); i >= (0); --i)
      if (((i / l) % 10) ^ 9) {
        f[i] = f[i] * f[i + l];
      }
    l = l * 10;
  }
  for (register long long i = (0); i <= (M); ++i) g[i] = f[i].f1;
  l = 1;
  long long Ans = 0;
  for (register long long k = (0); k <= (5); ++k) {
    for (register long long i = (0); i <= (M); ++i)
      if (((i / l) % 10) ^ 9) g[i] = (g[i] - g[i + l] + P) % P;
    l = l * 10;
  }
  for (register long long i = (0); i <= (M); ++i) Ans ^= (i * (g[i] % P));
  printf("%lld\n", Ans);
  return 0;
}
