#include <bits/stdc++.h>
inline long long gi() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x * f;
}
int S_tot[1000007], S_sum[1000007], S_cnt[1000007];
int pow2[1000010], inv[1000010];
int main() {
  int n = gi(), x;
  pow2[0] = pow2[1] = 1;
  for (int i = 2; i <= 1000000; ++i) pow2[i] = pow2[i - 1] * 2 % 1000000007;
  for (int i = 1; i <= n; ++i) {
    x = gi();
    S_sum[x] = (S_sum[x] + x) % 1000000007;
    ++S_cnt[x];
  }
  inv[1] = 1;
  for (int i = 2; i <= 1000000; ++i)
    inv[i] =
        1000000007 - 1ll * inv[1000000007 % i] * (1000000007 / i) % 1000000007;
  for (int i = 0; i < 1000000; ++i) {
    for (int j = 1, C = 1; j <= S_cnt[i]; ++j) {
      C = 1ll * C * (S_cnt[i] - j + 1) % 1000000007 * inv[j] % 1000000007;
      S_tot[i] = (S_tot[i] + 1ll * C * i % 1000000007 * i % 1000000007 * j %
                                 1000000007 * j % 1000000007) %
                 1000000007;
    }
  }
  for (int i = 1; i <= 100000; i *= 10)
    for (int j = 999999; ~j; --j)
      if (j / i % 10) {
        int at = S_tot[j], as = S_sum[j], ac = S_cnt[j];
        int bt = S_tot[j - i], bs = S_sum[j - i], bc = S_cnt[j - i];
        S_cnt[j - i] += ac;
        S_sum[j - i] = (as + bs) % 1000000007;
        S_tot[j - i] = (1ll * at * pow2[bc + 1] % 1000000007 +
                        1ll * bt * pow2[ac + 1] % 1000000007 +
                        1ll * 2 * as % 1000000007 * pow2[ac] % 1000000007 * bs %
                            1000000007 * pow2[bc] % 1000000007) %
                       1000000007;
      }
  for (int i = 1; i <= 100000; i *= 10)
    for (int j = 0; j < 1000000; ++j)
      if (j / i % 10 != 9)
        S_tot[j] = (S_tot[j] - S_tot[j + i] + 1000000007) % 1000000007;
  long long ans = 0;
  for (int i = 0; i < 1000000; ++i) ans ^= 1ll * i * S_tot[i];
  printf("%lld\n", ans);
  return 0;
}
