#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int V = 1000000;
int n;
int cnt[V];
struct cnt_tp {
  int a[3];
  int &operator[](int x) { return a[x]; }
  cnt_tp(int x = 1, int y = 0, int z = 0) { a[0] = x, a[1] = y, a[2] = z; }
  friend cnt_tp operator+=(cnt_tp &a, cnt_tp b) {
    a[2] = (1ll * a[0] * b[2] + 2ll * a[1] * b[1] + 1ll * a[2] * b[0]) % mod;
    a[1] = (1ll * a[0] * b[1] + 1ll * a[1] * b[0]) % mod;
    a[0] = 1ll * a[0] * b[0] % mod;
  }
} Sum[V];
int d[V];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    cnt[x]++;
  }
  for (int i = 0; i < V; i++) {
    while (cnt[i]--) Sum[i] += cnt_tp(2, i, 1ll * i * i % mod);
  }
  int pw[] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000};
  for (int i = 0; i < 6; i++)
    for (int j = V - 1; ~j; j--)
      if (j / pw[i] % 10 < 9) Sum[j] += Sum[j + pw[i]];
  for (int i = 0; i < V; i++) d[i] = Sum[i][2];
  for (int i = 0; i < 6; i++)
    for (int j = 0; j < V; j++)
      if (j / pw[i] % 10 < 9) (d[j] -= d[j + pw[i]]) %= mod;
  long long ans = 0;
  for (int i = 0; i < V; i++) ans ^= (d[i] + mod) % mod * 1ll * i;
  cout << ans;
  return 0;
}
