#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int n;
long long s1[1000000], s2[1000000], s3[1000000], lo[1000000], f[1000000], ans;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    long long x;
    scanf("%lld", &x);
    ++s1[x];
    s2[x] = (s2[x] + x) % mod;
    s3[x] = (s3[x] + x * x % mod) % mod;
  }
  for (int y = 1; y < 1000000; y *= 10)
    for (int i = 999999; i; i--)
      if (i / y % 10) {
        s1[i - y] = (s1[i - y] + s1[i]) % mod;
        s2[i - y] = (s2[i - y] + s2[i]) % mod;
        s3[i - y] = (s3[i - y] + s3[i]) % mod;
      }
  lo[0] = 1;
  for (int i = 1; i <= n; i++) lo[i] = lo[i - 1] * 2 % mod;
  for (int i = 999999; i; i--)
    if (s1[i]) {
      if (s1[i] == 1)
        f[i] = s3[i];
      else {
        f[i] = (s3[i] * lo[s1[i] - 1] % mod +
                lo[s1[i] - 2] * (s2[i] * s2[i] % mod - s3[i] + mod) % mod) %
               mod;
      }
    }
  for (int y = 1; y < 1000000; y *= 10)
    for (int i = 0; i < 1000000; i++)
      if (i / y % 10 < 9) f[i] = (f[i] - f[i + y] + mod) % mod;
  for (int i = 1; i <= 999999; i++) ans ^= f[i] * i;
  printf("%lld", ans);
}
