#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e5 + 5, INF = 1e9 + 7;
long long nums[MAXN];
int b[60];
int main() {
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> nums[i];
    for (int j = 0; j < 60; j++)
      if (nums[i] >> j & 1) b[j]++;
  }
  long long ans = 0;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 60; j++)
      if (nums[i] >> j & 1) b[j]--;
    for (int j = 0; j < 60; j++)
      if (nums[i] >> j & 1)
        ans = (ans + (1ll << j) % INF * (N - 1 - i - b[j]) % INF) % INF;
      else
        ans = (ans + (1ll << j) % INF * b[j] % INF) % INF;
    cout << ans << endl;
  }
  cout << ans % INF << endl;
  return 0;
}
