#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
using namespace std;
long long int MOD = 1000000000 + 7;


int main() {
	int N;
	cin >> N;
	vector<long long int> A(N);
	for (int i = 0; i < N; ++i) {
		scanf_s("%lld", &A[i]);
		//cin >> A[i];
	}
	long long int s = 0;
	for (int i = 0; i < N; ++i) {
		for (int j = i + 1; j < N; ++j) {
			s += (A[i] ^ A[j]) % MOD;
			s = s % MOD;
			cout << s << endl;
		}
	}
	cout << s;
}