#include <bits/stdc++.h>
using namespace std;
long long ans;
long long s0[1000005], s1[1000005], s2[1000005], g[1000005], cnt[1000005];
int n;
long long tw[1000005];
long long pw[1000005];
int pc[105], pad[105];
int main() {
  scanf("%d", &n);
  pw[0] = 1;
  for (int i = 1; i <= 6; i++) pw[i] = pw[i - 1] * 10;
  tw[0] = 1;
  for (int i = 1; i <= n; i++) {
    tw[i] = tw[i - 1] * 2 % 1000000007;
    int x;
    scanf("%d", &x);
    cnt[x]++;
  }
  for (int i = 1; i <= (1 << 6) - 1; i++) {
    for (int j = 1; j <= 6; j++)
      if (i & (1 << (j - 1))) {
        pc[i] ^= 1;
        pad[i] += pw[j - 1];
      }
  }
  for (int i = 999999; i >= 1; i--) {
    int cannot = 0;
    long long nowg = 0;
    for (int j = 1; j <= 6; j++)
      if (i / pw[j - 1] % 10 == 9) cannot += 1 << (j - 1);
    for (int j = 1; j <= (1 << 6) - 1; j++) {
      if (j & cannot) continue;
      int nxt = i + pad[j], nowcnt = pc[j];
      if (nowcnt == 1) {
        s0[i] = (s0[i] + s0[nxt]) % 1000000007;
        s1[i] = (s1[i] + s1[nxt]) % 1000000007;
        s2[i] = (s2[i] + s2[nxt]) % 1000000007;
        nowg = (nowg - g[nxt] + 1000000007) % 1000000007;
      } else {
        s0[i] = (s0[i] - s0[nxt] + 1000000007) % 1000000007;
        s1[i] = (s1[i] - s1[nxt] + 1000000007) % 1000000007;
        s2[i] = (s2[i] - s2[nxt] + 1000000007) % 1000000007;
        nowg = (nowg + g[nxt]) % 1000000007;
      }
    }
    s0[i] = (s0[i] + cnt[i]) % 1000000007;
    s1[i] = (s1[i] + i * cnt[i]) % 1000000007;
    s2[i] = (s2[i] + 1ll * i * i * cnt[i]) % 1000000007;
    if (s0[i]) {
      g[i] = (g[i] + tw[s0[i] - 1] * s2[i]) % 1000000007;
      long long tmp = (s1[i] * s1[i] - s2[i] + 1000000007) % 1000000007;
      if (s0[i] > 1) g[i] = (g[i] + tmp * tw[s0[i] - 2]) % 1000000007;
      nowg = (nowg + g[i]) % 1000000007;
    }
    ans ^= nowg * i;
  }
  printf("%lld", ans);
  return 0;
}
