#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  vector<string> sv(n);
  for (int i = 0; i < (n); ++i) cin >> sv[i];
  long long sum = 0;
  for (int i = 0; i < (n - 1); ++i) {
    for (int j = i + 1; j < n; ++j) {
      string tmp_s = "";
      for (int k = 0; k < (max(sv[i].length(), sv[j].length())); ++k) {
        if (sv[i].length() > k && sv[j].length() > k) {
          tmp_s += (char)(((sv[i][k] - '0') ^ (sv[j][k] - '0')) + '0');
        } else {
          if (sv[i].length() <= k) {
            tmp_s += sv[j][k];
          }
          if (sv[j].length() <= k) {
            tmp_s += sv[i][k];
          }
        }
      }
      long long num = 0;
      int ns = tmp_s.length();
      int idx = 0;
      long long keta = 1;
      while (1) {
        if (ns == 0) break;
        num = (num + (tmp_s[idx] - '0') * keta % mod) % mod;
        --ns;
        keta *= 10;
      }
      sum = (sum + num) % mod;
    }
  }
  cout << sum << endl;
  return 0;
}
