Your favorite music streaming platform has formed a perfectly balanced playlist exclusively for you. The playlist consists of n tracks numbered from 1 to n. The playlist is automatic and cyclic: whenever track i finishes playing, track i+1 starts playing automatically; after track n goes track 1.

For each track i, you have estimated its coolness a_i. The higher a_i is, the cooler track i is.

Every morning, you choose a track. The playlist then starts playing from this track in its usual cyclic fashion. At any moment, you remember the maximum coolness x of already played tracks. Once you hear that a track with coolness strictly less than x/2 (no rounding) starts playing, you turn off the music immediately to keep yourself in a good mood.

For each track i, find out how many tracks you will listen to before turning off the music if you start your morning with track i, or determine that you will never turn the music off. Note that if you listen to the same track several times, every time must be counted.

Input

The first line contains a single integer n (2 ≤ n ≤ 10^5), denoting the number of tracks in the playlist.

The second line contains n integers a_1, a_2, …, a_n (1 ≤ a_i ≤ 10^9), denoting coolnesses of the tracks.

Output

Output n integers c_1, c_2, …, c_n, where c_i is either the number of tracks you will listen to if you start listening from track i or -1 if you will be listening to music indefinitely.

Examples

Input


4
11 5 2 7


Output


1 1 3 2


Input


4
3 2 5 3


Output


5 4 3 6


Input


3
4 3 6


Output


-1 -1 -1

Note

In the first example, here is what will happen if you start with... 

  * track 1: listen to track 1, stop as a_2 < (a_1)/(2). 
  * track 2: listen to track 2, stop as a_3 < (a_2)/(2). 
  * track 3: listen to track 3, listen to track 4, listen to track 1, stop as a_2 < (max(a_3, a_4, a_1))/(2). 
  * track 4: listen to track 4, listen to track 1, stop as a_2 < (max(a_4, a_1))/(2). 



In the second example, if you start with track 4, you will listen to track 4, listen to track 1, listen to track 2, listen to track 3, listen to track 4 again, listen to track 1 again, and stop as a_2 < (max(a_4, a_1, a_2, a_3, a_4, a_1))/(2). Note that both track 1 and track 4 are counted twice towards the result.
import java.io.*;
import java.util.*;

public class Main1 {

	static FastReader input = new FastReader();
	static PrintWriter out = new PrintWriter(System.out);
	static int st[];
	static int arr[];

	public static void build(int i, int l, int r) {
		if (l == r)
			st[i] = arr[l];

		else {
			build(i << 1, l, (l + r) / 2);
			build((i << 1) + 1, (l + r) / 2 + 1, r);
			st[i] = Math.max(st[i << 1], st[(i << 1) + 1]);
		}

	}

	public static int query(int i, int l, int r, int a, int b) {

		if (l >= a && r <= b)
			return st[i];

		else if (l > b || r < a)
			return Integer.MIN_VALUE;

		return Math.max(query(i << 1, l, (l + r) / 2, a, b), query((i << 1) + 1, (l + r) / 2 + 1, r, a, b));
	}

	public static void main(String args[]) throws NumberFormatException, IOException {

		int n = input.nextInt();
		Pair[] a = new Pair[2 * n];
		arr = new int[2 * n];
		st = new int[4 * 2 * n];
		int ans[] = new int[2 * n];

		for (int i = 0; i < n; i++) {
			a[i] = new Pair(input.nextInt(), i);
			arr[i] = a[i].x;
		}
		for (int i = n; i < 2 * n; i++) {
			a[i] = new Pair(a[i % n].x, a[i % n].y + n);
			arr[i] = a[i].x;
		}

		PriorityQueue<Pair> pq = new PriorityQueue<>(Collections.reverseOrder());

		// out.println(Arrays.toString(a));
		build(1, 0, 2 * n - 1);

		for (int i = 0; i < 2 * n; i++) {
			int x = 2 * a[i].x;

			while (!pq.isEmpty() && pq.peek().x > x) {
				Pair remv = pq.poll();
				int lmax = query(1, 0, 2 * n - 1, remv.y, i);
				if (lmax <= remv.x)
					ans[remv.y] = i - remv.y;
			}
			pq.add(a[i]);
		}
		// out.println(Arrays.toString(ans));

		for (int i = 0; i < n; i++) {
			if (ans[i] != 0) {
				ans[i + n] = ans[i];
			}
			if (ans[i + n] != 0) {
				ans[i] = ans[i + n];
			}
		}

		for (int i = 2 * n - 1; i >= 0;) {
			int j = i - 1;
			if (ans[i] != 0) {
				while (j >= 0 && ans[j] == 0) { ans[j] = ans[j + 1] + 1; }
			}
			i = j;
		}

		boolean bad = false;
		for (int i = 0; i < n; i++) {
			if (ans[i] == 0) {
				bad = true;
			}
		}
		for (int i = 0; i < n; i++) {
			if (bad) {
				out.print(-1 + " ");
			} else {
				out.print(ans[i] + " ");
			}
		}

		out.flush();
	}

	static int shlf(int bit) { return 1 << bit; }

	static boolean isOn(int bit, int mask) { return ((1 << bit) & mask) != 0; }

	static int light(int bit, int mask) { return (1 << bit) | mask; }

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			// try {
			// br = new BufferedReader(new FileReader(new File("chess.in")));
			// } catch (FileNotFoundException e) {
			// e.printStackTrace();
			// }
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() throws IOException {
			while (st == null || !st.hasMoreElements()) { st = new StringTokenizer(br.readLine()); }
			return st.nextToken();
		}

		int nextInt() throws NumberFormatException, IOException { return Integer.parseInt(next()); }

		long nextLong() throws NumberFormatException, IOException { return Long.parseLong(next()); }

		double nextDouble() throws NumberFormatException, IOException { return Double.parseDouble(next()); }

		String nextLine() throws IOException {
			String str = "";
			str = br.readLine();
			return str;
		}

		boolean hasNext() throws IOException { return br.ready(); }
	}

	static class con {
		static int IINF = (int) 1e9;
		static int _IINF = (int) -1e9;
		static long LINF = (long) 1e15;
		static long _LINF = (long) -1e15;
		static double EPS = 1e-9;
	}

	static class Triple implements Comparable<Triple> {
		int x;
		int y;

		int z;

		Triple(int x, int y, int z) {
			this.x = x;
			this.y = y;
			this.z = z;
		}

		@Override
		public int compareTo(Triple o) {
			if (x == o.x && y == o.y)
				return z - o.z;
			if (x == o.x)
				return y - o.y;
			return x - o.x;
		}

		@Override
		public String toString() { return "(" + x + ", " + y + ", " + z + ")"; }
	}

	static class Pair implements Comparable<Pair> {
		int x;
		int y;

		Pair(int x, int y) {
			this.x = x;
			this.y = y;

		}

		@Override
		public int compareTo(Pair o) {
			if (x == o.x)
				return (int) (y - o.y);
			return (int) (x - o.x);
		}

		@Override
		public String toString() {

			return "(" + x + ", " + y + ")";
		}

	}

	static void shuffle(int[] a) {
		for (int i = 0; i < a.length; i++) {
			int r = i + (int) (Math.random() * (a.length - i));
			int tmp = a[r];
			a[r] = a[i];
			a[i] = tmp;
		}
	}

	static void shuffle(long[] a) {
		for (int i = 0; i < a.length; i++) {
			int r = i + (int) (Math.random() * (a.length - i));
			long tmp = a[r];
			a[r] = a[i];
			a[i] = tmp;
		}
	}

	static int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }

	static long gcd(long a, long b) { return b == 0 ? a : gcd(b, a % b); }

	static class DSU {

		int[] p, rank, setSize;
		int numSets;

		DSU(int n) {
			p = new int[n];
			rank = new int[n];
			setSize = new int[n];
			numSets = n;

			for (int i = 0; i < n; i++) {
				p[i] = i;
				setSize[i] = 1;
			}

		}

		int findSet(int n) { return p[n] = p[n] == n ? n : findSet(p[n]); }

		boolean isSameSet(int n, int m) { return findSet(n) == findSet(m); }

		void mergeSet(int n, int m) {

			if (!isSameSet(n, m)) {
				numSets--;
				int p1 = findSet(n);
				int p2 = findSet(m);

				if (rank[p1] > rank[p2]) {
					p[p2] = p1;
					setSize[p1] += setSize[p2];
				} else {
					p[p1] = p2;
					setSize[p2] += setSize[p1];
					if (rank[p1] == rank[p2])
						rank[p1]++;
				}
			}

		}

		int size() { return numSets; }

		int setSize(int n) { return setSize[findSet(n)]; }

	}

	static class Reader {
		final private int BUFFER_SIZE = 1 << 16;
		private DataInputStream din;
		private byte[] buffer;
		private int bufferPointer, bytesRead;

		public Reader() {
			din = new DataInputStream(System.in);
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public Reader(String file_name) throws IOException {
			din = new DataInputStream(new FileInputStream(file_name));
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public String readLine() throws IOException {
			byte[] buf = new byte[1024];
			int cnt = 0, c;
			while ((c = read()) != -1) {
				if (c == '\n')
					break;
				buf[cnt++] = (byte) c;
			}
			return new String(buf, 0, cnt);
		}

		public int nextInt() throws IOException {
			int ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do { ret = ret * 10 + c - '0'; } while ((c = read()) >= '0' && c <= '9');
			if (neg)
				return -ret;
			return ret;
		}

		public long nextLong() throws IOException {
			long ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do { ret = ret * 10 + c - '0'; } while ((c = read()) >= '0' && c <= '9');
			if (neg)
				return -ret;
			return ret;
		}

		// ddd
		public double nextDouble() throws IOException {
			double ret = 0, div = 1;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do { ret = ret * 10 + c - '0'; } while ((c = read()) >= '0' && c <= '9');
			if (c == '.')
				while ((c = read()) >= '0' && c <= '9')
					ret += (c - '0') / (div *= 10);
			if (neg)
				return -ret;
			return ret;
		}

		private void fillBuffer() throws IOException {
			bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			if (bytesRead == -1)
				buffer[0] = -1;
		}

		private byte read() throws IOException {
			if (bufferPointer == bytesRead)
				fillBuffer();
			return buffer[bufferPointer++];
		}

		public void close() throws IOException {
			if (din == null)
				return;
			din.close();
		}
	}

	static ArrayList<Integer>[] allocateArrayList(int n) {
		ArrayList<Integer> g[] = new ArrayList[n];
		for (int i = 0; i < n; i++) { g[i] = new ArrayList<>(); }
		return g;
	}

	static ArrayList<Integer> sieve(int n) {
		boolean notprimes[] = new boolean[n];

		for (int i = 2; i * i <= n; i++) {
			for (int j = i * i; j <= n && !notprimes[i]; j += i) { notprimes[j] = true; }
		}
		ArrayList<Integer> ret = new ArrayList<>();
		for (int i = 2; i < notprimes.length; i++)
			if (!notprimes[i])
				ret.add(i);
		return ret;
	}
}