#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<bitset<60>> A(N, bitset<60>(0));
  for (int n = 0; n < N; n++) {
    uint64_t num;
    cin >> num;
    A.at(n) = bitset<60>(num);
  }
  cout << A.at(9).to_ulong() << endl;
  uint64_t sum = 0;
  for (int i = 0; i < N - 1; i++) {
    for (int j = i + 1; j < N; j++) {
      sum += (A.at(i) ^ A.at(j)).to_ullong();
    }
  }
  cout << sum << endl;
  sum %= 1000000007;
  cout << sum << endl;
}
