#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  bool flag = false;
  while (!isdigit(c)) {
    if (c == '-') flag = true;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  if (flag) x = -x;
}
int n, now, all = 1000000;
long long ans;
long long f[1000010], g[1000010], h[1000010], pw[1000010];
void FWT(long long *a) {
  for (int len = 1; len < all; len *= 10)
    for (int i = all - 1; i >= 0; --i)
      if (i / len % 10) a[i - len] = (a[i - len] + a[i]) % 1000000007;
}
void IFWT(long long *a) {
  for (int len = 1; len < all; len *= 10)
    for (int i = 0; i < all; ++i)
      if (i / len % 10)
        a[i - len] = (a[i - len] - a[i] + 1000000007) % 1000000007;
}
int main() {
  read(n), pw[0] = 1;
  for (int i = 1, x; i <= n; ++i)
    read(x), f[x]++, g[x] = (g[x] + x) % 1000000007,
                     h[x] = (h[x] + (long long)x * x % 1000000007) % 1000000007,
                     pw[i] = pw[i - 1] * 2 % 1000000007;
  FWT(f), FWT(g), FWT(h);
  for (int i = 0; i < all; ++i)
    if (f[i])
      f[i] = f[i] == 1 ? h[i]
                       : pw[f[i] - 2] * (g[i] * g[i] % 1000000007 + h[i]) %
                             1000000007;
  IFWT(f);
  for (int i = 0; i < all; ++i) ans ^= f[i] * i;
  printf("%lld", ans);
  return 0;
}
