#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 100;
long long a[N], b[N], c[N], p[10], f[N], bt[N];
const long long mod = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 1, x; i <= n; i++)
    cin >> x, a[x]++, b[x] += x, c[x] = (c[x] + 1ll * x * x) % mod;
  p[0] = 1;
  for (int i = 1; i <= 6; i++) p[i] = p[i - 1] * 10;
  for (int j = 0; j <= 5; j++) {
    for (int i = (1000000) - 1; i >= 0; i--) {
      if (i / p[j] % 10) {
        a[i - p[j]] = (a[i - p[j]] + a[i]) % mod;
        b[i - p[j]] = (b[i - p[j]] + b[i]) % mod;
        c[i - p[j]] = (c[i - p[j]] + c[i]) % mod;
      }
    }
  }
  bt[0] = 1;
  for (int i = 1; i <= n; i++) bt[i] = (bt[i - 1] << 1) % mod;
  for (int i = 0; i < 1000000; i++) {
    if (a[i] == 0) continue;
    if (a[i] == 1)
      f[i] = c[i];
    else
      f[i] = bt[a[i] - 2] * (b[i] * b[i] % mod + c[i]) % mod;
  }
  for (int j = 0; j <= 5; j++) {
    for (int i = 0; i < 1000000; i++) {
      if (i / p[j] % 10) f[i - p[j]] = (f[i - p[j]] - f[i] + mod) % mod;
    }
  }
  long long ans = 0;
  for (int i = 0; i < 1000000; i++) ans ^= f[i] * i;
  printf("%lld", ans);
}
