#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
inline long long mul(const long long& a, const long long& b) {
  return (a * b) % mod;
}
inline long long add(const long long& a, const long long& b) {
  return (a + b + mod) % mod;
}
inline void upd(long long& a, const long long& b) { a = (a + b + mod) % mod; }
const int maxn = 1e6, logn = 6;
vector<int> p10(logn + 1, 1), p2(maxn, 1);
int getd(int x, int i) { return (x / p10[i]) % 10; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  for (int i = 1; i < maxn; i++) p2[i] = mul(p2[i - 1], 2);
  for (int i = 1; i < p10.size(); i++) p10[i] = mul(p10[i - 1], 10);
  int n;
  cin >> n;
  vector<long long> sum(maxn, 0), sum2(maxn, 0), cnt(maxn, 0);
  for (int i = 0, a; i < n; i++) {
    cin >> a;
    upd(sum2[a], mul(a, a));
    upd(sum[a], a);
    cnt[a]++;
  }
  for (int d = 0; d < logn; d++)
    for (int i = maxn - 1; i >= 0; i--) {
      if (getd(i, d) == 0) continue;
      upd(sum2[i - p10[d]], sum2[i]);
      upd(sum[i - p10[d]], sum[i]);
      upd(cnt[i - p10[d]], cnt[i]);
    }
  vector<long long> g(maxn, 0);
  for (int i = 0; i < maxn; i++) {
    if (!cnt[i]) continue;
    long long self = mul(sum2[i], p2[cnt[i] - 1]), other = 0;
    if (cnt[i] >= 2)
      other = mul(add(mul(sum[i], sum[i]), -sum2[i]), p2[cnt[i] - 2]);
    upd(g[i], add(self, other));
  }
  for (int d = 0; d < logn; d++)
    for (int i = 0; i < maxn; i++) {
      if (getd(i, d) == 0) continue;
      upd(g[i - p10[d]], -g[i]);
    }
  long long ans = 0;
  for (long long i = 0; i < maxn; i++) {
    ans ^= i * g[i];
  }
  cout << ans << "\n";
  return 0;
}
