#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000010;
const long long P = 1000000007;
int n, len;
long long ans;
long long a[maxn], b[maxn], c[maxn], f[maxn], bt[maxn];
inline int rd() {
  int ret = 0, f = 1;
  char gc = getchar();
  while (gc < '0' || gc > '9') {
    if (gc == '-') f = -f;
    gc = getchar();
  }
  while (gc >= '0' && gc <= '9') ret = ret * 10 + gc - '0', gc = getchar();
  return ret * f;
}
inline void fwt() {
  int h, i;
  for (h = 1; h < len; h *= 10) {
    for (i = len - 1; ~i; i--)
      if (i / h % 10) {
        a[i - h] = (a[i - h] + a[i]) % P;
        b[i - h] = (b[i - h] + b[i]) % P;
        c[i - h] = (c[i - h] + c[i]) % P;
      }
  }
}
inline void ufwt() {
  int h, i;
  for (h = 1; h < len; h *= 10) {
    for (i = 0; i < len; i++)
      if (i / h % 10) {
        f[i - h] = (f[i - h] - f[i] + P) % P;
      }
  }
}
int main() {
  n = rd();
  int i;
  long long x;
  for (i = 1; i <= n; i++)
    x = rd(), a[x]++, b[x] = (b[x] + x) % P, c[x] = (c[x] + x * x) % P;
  len = 1000000;
  fwt();
  for (bt[0] = i = 1; i <= n; i++) bt[i] = (bt[i - 1] << 1) % P;
  for (i = 0; i < len; i++) {
    if (!a[i]) continue;
    if (a[i] == 1)
      f[i] = c[i];
    else
      f[i] = bt[a[i] - 2] * (b[i] * b[i] % P + c[i]) % P;
  }
  ufwt();
  for (i = 0; i < len; i++) ans ^= f[i] * i;
  printf("%lld", ans);
  return 0;
}
