#include <bits/stdc++.h>
const long long MOD = 1000000007;
long long S2[1000000], S[1000000], PW[1000001];
int C[1000000];
int main() {
  PW[0] = 1;
  for (int i = 1; i <= 1000000; i++) PW[i] = PW[i - 1] * 2 % MOD;
  int N;
  for (scanf("%d", &N); N--;) {
    int x;
    scanf("%d", &x);
    S2[x] = (S2[x] + (long long)x * x) % MOD;
    S[x] = (S[x] + x) % MOD;
    C[x]++;
  }
  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] = (S2[k] + S2[k + i]) % MOD;
        S[k] = (S[k] + S[k + i]) % MOD;
        C[k] += C[k + i];
      }
  for (int i = 0; i < 1000000; i++)
    S[i] = ((S[i] * S[i] - S2[i] + MOD) % MOD * (C[i] < 2 ? 0 : PW[C[i] - 2]) %
                MOD +
            S2[i] * (C[i] < 1 ? 0 : PW[C[i] - 1]) % MOD) %
           MOD;
  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] = (S[k] - S[k + i] + MOD) % MOD;
  long long O = 0;
  for (int i = 0; i < 1000000; i++) O ^= i * S[i];
  printf("%lld\n", O);
  return 0;
}
