#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long a[n];
  long long sum = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    sum += a[i];
  }
  long long sumxor = 0;
  for (int i = 0; i < n; i++) {
    sumxor = sumxor + a[i] ^ sum;
    cout << sumxor << endl;
  }
  long long ans;
  ans = sumxor % 1000000007;
  cout << ans << endl;
}
