#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long dp0[1111111], dp1[1111111], dp2[1111111], xxx[8], p[1111111];
void add(long long &a, long long b) {
  a += b;
  if (a >= mod) a -= mod;
}
void sub(long long &a, long long b) {
  a -= b;
  if (a < 0) a += mod;
}
int main() {
  xxx[0] = 1;
  for (int i = 1; i < 8; i++) xxx[i] = xxx[i - 1] * 10;
  int n, a;
  scanf("%d", &n);
  p[0] = 1;
  for (int i = 1; i < n + 1; i++)
    scanf("%d", &a), p[i] = p[i - 1] * 2 % mod, dp0[a]++, add(dp1[a], a),
                     (dp2[a] += a * 1LL * a) %= mod;
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 1e6; j++) {
      int k = (j % xxx[i + 1]) / xxx[i];
      for (int kk = k + 1; kk < 10; kk++)
        add(dp0[j], dp0[j - k * xxx[i] + kk * xxx[i]]),
            add(dp1[j], dp1[j - k * xxx[i] + kk * xxx[i]]),
            add(dp2[j], dp2[j - k * xxx[i] + kk * xxx[i]]);
    }
  }
  for (int j = 0; j < 1e6; j++)
    if (dp0[j]) {
      if (dp0[j] > 1)
        dp0[j] =
            (p[dp0[j] - 2] * dp1[j] % mod * dp1[j] + dp2[j] * p[dp0[j] - 2]) %
            mod;
      else
        dp0[j] = dp2[j];
    }
  for (int i = 0; i < 6; i++) {
    for (int j = xxx[6] - 1; j >= 0; j--) {
      int k = (j % xxx[i + 1]) / xxx[i];
      for (int kk = k + 1; kk < 10; kk++)
        sub(dp0[j], dp0[j - k * xxx[i] + kk * xxx[i]]);
    }
  }
  long long res = 0;
  for (int i = 0; i < 1e6; i++) res ^= i * dp0[i];
  printf("%I64d\n", res);
}
