#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const long long LINF = INF * (long long)INF;
const int MAX = 1000100;
const int MOD = 1000 * 1000 * 1000 + 7;
int A[MAX];
long long CNT[MAX];
long long S[MAX];
long long S2[MAX];
long long F[MAX];
long long G[MAX];
long long p2[MAX];
long long p10[MAX];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  p10[0] = 1;
  for (int i = (1); i < (10); i++) p10[i] = p10[i - 1] * 10;
  p2[0] = 1;
  for (int i = (1); i < (MAX); i++) p2[i] = (p2[i - 1] * 2) % MOD;
  int n;
  cin >> n;
  for (int i = (0); i < (n); i++) {
    cin >> A[i];
    ++CNT[A[i]];
    S[A[i]] = (S[A[i]] + A[i]) % MOD;
    S2[A[i]] = (S2[A[i]] + A[i] * (long long)A[i]) % MOD;
  }
  int up = 1000000;
  vector<int> a;
  for (int i = (up)-1; i >= (0); i--) {
    a.clear();
    int x = i;
    for (int j = (0); j < (6); j++) {
      a.push_back(x % 10);
      x /= 10;
    }
    for (int mask = (1); mask < (1 << 6); mask++) {
      int x = i;
      bool ok = true;
      int b = 0;
      for (int j = (0); j < (6); j++) {
        int dig = a[j];
        if (mask & (1 << j)) {
          b ^= 1;
          if (dig == 9) {
            ok = false;
            break;
          }
          x += p10[j];
        }
      }
      if (!ok) continue;
      if (b & 1) {
        CNT[i] += CNT[x];
        S[i] += S[x];
        S2[i] += S2[x];
      } else {
        CNT[i] += MOD - CNT[x];
        S2[i] += MOD - S2[x];
        S[i] += MOD - S[x];
      }
      if (CNT[i] >= MOD) CNT[i] -= MOD;
      if (S[i] >= MOD) S[i] -= MOD;
      if (S2[i] >= MOD) S2[i] -= MOD;
    }
  }
  for (int i = (0); i < (up); i++) {
    if (CNT[i] == 0) continue;
    if (CNT[i] == 1) {
      F[i] = S2[i];
      continue;
    }
    F[i] = (S[i] * S[i] % MOD + S2[i]) * p2[CNT[i] - 2] % MOD;
  }
  for (int i = (up)-1; i >= (0); i--) {
    a.clear();
    int x = i;
    for (int j = (0); j < (6); j++) {
      a.push_back(x % 10);
      x /= 10;
    }
    for (int mask = (0); mask < (1 << 6); mask++) {
      int x = i;
      bool ok = true;
      int b = 0;
      for (int j = (0); j < (6); j++) {
        int dig = a[j];
        if (mask & (1 << j)) {
          b ^= 1;
          if (dig == 9) {
            ok = false;
            break;
          }
          x += p10[j];
        }
      }
      if (!ok) continue;
      if (b) {
        G[i] += MOD - F[x];
      } else {
        G[i] += F[x];
      }
      if (G[i] >= MOD) G[i] -= MOD;
    }
  }
  long long ans = 0;
  for (int i = (0); i < (up); i++) {
    ans ^= G[i] * i;
  }
  cout << ans;
}
