#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
int mem[N];
pair<int, int> btree[4 * N];
int arr[N];
int n, m;
pair<int, int> merg(pair<int, int> a, pair<int, int> b) {
  return {min(a.first, b.first), max(a.second, b.second)};
}
void build(int node, int l, int r) {
  if (l == r) {
    btree[node] = {arr[l], arr[l]};
    return;
  }
  int mid = (l + r) / 2;
  build(node * 2, l, mid);
  build(node * 2 + 1, mid + 1, r);
  btree[node] = merg(btree[node * 2], btree[node * 2 + 1]);
}
pair<int, int> query(int node, int l, int r, int ql, int qr) {
  if (r < ql || qr < l) return {(1 << 30), -(1 << 30)};
  if (ql <= l && r <= qr) return btree[node];
  int mid = (l + r) / 2;
  return merg(query(node * 2, l, mid, ql, qr),
              query(node * 2 + 1, mid + 1, r, ql, qr));
}
int get(int x) {
  if (mem[x] != -1) return mem[x];
  auto a = query(1, 0, m - 1, x, m - 1);
  if (a.first >= (a.second + 1) / 2) return -1;
  int st = x, en = m - 1, ans = m - 1;
  while (st <= en) {
    int mid = (st + en) / 2;
    auto a = query(1, 0, m - 1, x, mid);
    if (a.first < (a.second + 1) / 2) {
      ans = mid;
      en = mid - 1;
    } else
      st = mid + 1;
  }
  if (arr[ans] == query(1, 0, m - 1, x, ans).second)
    return mem[x] = get(ans) + (ans - x);
  return mem[x] = ans - x;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  for (int i = n; i < 3 * n; i++) arr[i] = arr[i - n];
  m = 3 * n;
  build(1, 0, m - 1);
  memset(mem, -1, sizeof mem);
  for (int i = 0; i < n; i++) {
    printf("%d ", get(i));
  }
  return 0;
}
