#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char ch = getchar();
  int w = 1, c = 0;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') w = -1;
  for (; isdigit(ch); ch = getchar()) c = (c << 1) + (c << 3) + (ch ^ 48);
  return w * c;
}
const int mod = 1e9 + 7, M = 1e6 + 10;
struct node {
  long long x, y, z;
  node(long long _ = 1, long long __ = 0, long long ___ = 0) {
    x = _;
    y = __;
    z = ___;
  }
} a[M];
long long b[M];
node operator+(node A, node B) {
  return node(A.x * B.x % mod, (A.y * B.x + B.y * A.x) % mod,
              (A.x * B.z + A.z * B.x + 2ll * A.y * B.y) % mod);
}
int n;
int main() {
  n = read();
  for (int i = (1); i <= (n); ++i) {
    int x = read();
    a[x] = a[x] + node(2, x, 1ll * x * x % mod);
  }
  for (int len = 1; len <= 100000; len *= 10) {
    for (int j = (999999); j >= (0); --j) {
      if ((j / len) % 10) {
        a[j - len] = a[j - len] + a[j];
      }
    }
  }
  for (int i = (0); i <= (999999); ++i) b[i] = a[i].z;
  for (int len = 1; len <= 100000; len *= 10) {
    for (int j = (0); j <= (999999); ++j) {
      if ((j / len) % 10) {
        b[j - len] += mod - b[j];
        b[j - len] %= mod;
      }
    }
  }
  long long ans = 0;
  for (int i = (0); i <= (999999); ++i) {
    ans ^= b[i] * i;
  }
  cout << ans << "\n";
  return 0;
}
