#include <bits/stdc++.h>
using namespace std;
int n, a[1000005], s[1000005][3], ans[1000005], pw[15], bin[1000005];
int main() {
  scanf("%d", &n);
  int i, j, k;
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    k = 999999 - a[i];
    s[k][0]++;
    s[k][1] = (s[k][1] + a[i]) % 1000000007;
    s[k][2] = (s[k][2] + (long long)a[i] * a[i]) % 1000000007;
  }
  pw[0] = bin[0] = 1;
  for (i = 1; i <= 6; i++) pw[i] = pw[i - 1] * 10;
  for (i = 1; i <= n; i++) bin[i] = (bin[i - 1] << 1) % 1000000007;
  for (i = 1; i <= 6; i++)
    for (j = 0; j < 1000000; j++)
      if (j / pw[i - 1] % 10)
        for (k = 0; k < 3; k++)
          s[j][k] = (s[j][k] + s[j - pw[i - 1]][k]) % 1000000007;
  for (i = 0; i < 1000000; i++)
    if (s[i][0]) {
      ans[i] = (long long)bin[s[i][0] - 1] * s[i][2] % 1000000007;
      if (s[i][0] > 1)
        ans[i] = (ans[i] + (long long)bin[s[i][0] - 2] *
                               ((long long)s[i][1] * s[i][1] % 1000000007 -
                                s[i][2] + 1000000007)) %
                 1000000007;
    }
  for (i = 1; i <= 6; i++)
    for (j = 999999; j >= 0; j--)
      if (j / pw[i - 1] % 10)
        ans[j] = (ans[j] - ans[j - pw[i - 1]] + 1000000007) % 1000000007;
  long long sum = 0;
  for (i = 0; i < 1000000; i++) sum ^= (long long)ans[i] * (999999 - i);
  printf("%lld\n", sum);
  return 0;
}
