#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
inline int add(int a, int b) {
  a += b;
  if (a >= mod) a -= mod;
  return a;
}
inline int mult(int a, int b) {
  long long t = 1ll * a * b;
  if (t >= mod) t %= mod;
  return t;
}
inline int dec(int a, int b) {
  a -= b;
  if (a < 0) a += mod;
  return a;
}
int pw[1000010], n, s[1000010], s2[1000010], c[1000010];
int main() {
  pw[0] = 1;
  for (int i = 1; i <= 1000000; i++) pw[i] = add(pw[i - 1], pw[i - 1]);
  scanf("%d", &n);
  for (int i = 1, ti; i <= n; i++) {
    scanf("%d", &ti);
    s2[ti] = add(s2[ti], mult(ti, ti));
    s[ti] = add(s[ti], ti);
    c[ti]++;
  }
  for (int i = 1; i < 1000000; i *= 10) {
    for (int j = 0; j < 1000000; j += i * 10) {
      for (int k = j + i * 9 - 1; k >= j; k--) {
        s2[k] = add(s2[k], s2[k + i]);
        s[k] = add(s[k], s[k + i]);
        c[k] = add(c[k], c[k + i]);
      }
    }
  }
  for (int i = 0; i < 1000000; i++)
    s[i] =
        add(mult(dec(mult(s[i], s[i]), s2[i]), (c[i] < 2 ? 0 : pw[c[i] - 2])),
            mult(s2[i], (c[i] < 1 ? 0 : pw[c[i] - 1])));
  for (int i = 1; i < 1000000; i *= 10) {
    for (int j = 0; j < 1000000; j += i * 10) {
      for (int k = j; k < j + i * 9; k++) {
        s[k] = dec(s[k], s[k + i]);
      }
    }
  }
  long long out = 0;
  for (int i = 1; i < 1000000; i++) out ^= 1ll * i * s[i];
  printf("%lld\n", out);
  return 0;
}
