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.*;
import java.math.*;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class BalancedPlaylist {
    public static void main(String[] args) throws IOException {
        OutputStream outputStream = System.out;
        Reader in = new Reader();
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }
    static class TaskA {
        int mod = (1000000007);
        public void solve(int testNumber, Reader in, PrintWriter out) throws IOException{
        	while(testNumber-->0){
                int n = in.nextInt();
                long a[] = new long[n];
                int ans[] = new int[n];
                long max = Long.MIN_VALUE;
                long min = Long.MAX_VALUE;
                int pos = -1;

                for(int i=0;i<n;i++){
                	a[i] = in.nextLong();
                	if(max<=a[i]){
                		max = a[i];
                		pos = i;
                	}
                	min = Math.min(min , a[i]);
                }
                if(max<=min*2){
                	for(int i=0;i<n;i++)
                		out.print("-1 ");
                	out.println();
                	continue;
                }

                int ng[] = new int[n];
                int nl[] = new int[n];
                nextGreater(a , ng , n);
                nextLesser(a , nl , n);

                int val = 0;
                int count = n;
                int i = pos;
                long y = (max%2==0)?max/2:max/2+1;
                while(count-->0){
                	long x = a[i];
                	if(x<y){
                		break;
                	}
                	val++;
                	i = (i+1)%n;
                }
                if(val == n)
                	ans[pos] = -1;
                else
                	ans[pos] = val;

                // print1d(ans , out);

                count = n-1;
                i = pos;
                while(count-->0){
                	i = (i-1+n)%n;
                	if(a[i]<=a[(i+1)%n]){
                		ans[i] = 1+ans[(i+1)%n];
                	}
                	else{
                		int nextGreater = ng[i];
                		int nextSmaller = nl[i];
                		if(nextSmaller == -1)
                			nextSmaller = Integer.MAX_VALUE;
                		if(nextGreater<i)
                			nextGreater += n;
                		if(nextSmaller<i)
                			nextSmaller += n;
                		if(nextGreater<nextSmaller){
                			ans[i] = nextGreater - i + ans[ng[i]];
                		}
                		else{
                			ans[i] = nextSmaller - i;
                		}
                	}
                }
                // print1d(ng , out);
                // print1d(nl , out);
                print1d(ans , out);
            }
        }
        public void nextGreater(long a[] , int []ng , int n){
        	Stack<Combine> s = new Stack<>();
        	for(int i=0;i<2*n;i++){
        		int k = i%n;
        		Combine c = new Combine(a[k] , k);
        		while(s.size()>0 && s.peek().value <= c.value){
    				Combine d = s.pop();
    				if(ng[d.delete]==0)
	    				ng[d.delete] = c.delete;

        		}
        // 		for(Combine x : s)
    				// System.out.println(x.value + " " + x.delete);
        		s.push(c);
        	}
        	// for(int i=0;i<n;i++)
        	// 	System.out.print(ng[i] + " ");
        	// System.out.println();
        }
        public void nextLesser(long a[] , int nl[] , int n){
        	ArrayList<Combine> c = new ArrayList<>();
        	for(int i=0;i<n;i++)
        		c.add(new Combine(a[i] , i));
        	Collections.sort(c , new Sort2());
        	long b[] = new long[n];
        	for(int i=0;i<n;i++)
        		b[i] = c.get(i).value;
        	TreeSet<Integer> t = new TreeSet<>();
        	int start = 0;
        	for(int i=0;i<n;i++){
        		long val = (b[i]%2==0)?b[i]/2:b[i]/2+1;
        		int x = lowerLastBound(b , val);
        		if(x == -1){
        			nl[c.get(i).delete] = -1;
        			continue;
        		}
        		for(start = start;start<=x;start++)
        			t.add(c.get(start).delete);
        		int y;
        		try{
        			y = t.higher(c.get(i).delete);
        		}
        		catch(Exception e){
        			y = t.first();
        		}
        		nl[c.get(i).delete] = y;
        	}
        }
        class Combine{
            long value;
            int delete;
            Combine(long val , int delete){
                this.value = val;
                this.delete = delete;
            }
        }
        class Sort2 implements Comparator<Combine>{
            public int compare(Combine a , Combine b){
                if(a.value > b.value)
                    return 1;
                else if(a.value == b.value && a.delete>b.delete)
                    return 1;
                else if(a.value == b.value && a.delete == b.delete)
                    return 0;
                return -1;
            }
        }
        class Sort1 implements Comparator<Character>{
        	public int compare(Character a , Character b){
        		char a1 = a.charValue();
        		char b1 = b.charValue();
        		if(a1>b1)
        			return 1;
        		return -1;
        	}
        }
        public void sieve(int a[]){
        	a[0] = a[1] = 1;
        	int i;
        	for(i=2;i*i<=a.length;i++){
        		if(a[i] != 0)
        			continue;
        		a[i] = i;
        		for(int k = (i)*(i);k<a.length;k+=i){
        			if(a[k] != 0)
        				continue;
        			a[k] = i;
        		}
        	}
        }
        public int [][] matrixExpo(int c[][] , int n){
            int a[][] = new int[c.length][c[0].length];
            int b[][] = new int[a.length][a[0].length];
            for(int i=0;i<c.length;i++)
                for(int j=0;j<c[0].length;j++)
                    a[i][j] = c[i][j];
            for(int i=0;i<a.length;i++)
                b[i][i] = 1;
            while(n!=1){
                if(n%2 == 1){
                    b = matrixMultiply(a , a);
                    n--;
                }
                a = matrixMultiply(a , a);
                n/=2;
            }
            return matrixMultiply(a , b);
        }
        public int [][] matrixMultiply(int a[][] , int b[][]){
            int r1 = a.length;
            int c1 = a[0].length;
            int c2 = b[0].length;
            int c[][] = new int[r1][c2];
            for(int i=0;i<r1;i++){
                for(int j=0;j<c2;j++){
                    for(int k=0;k<c1;k++)
                        c[i][j] += a[i][k]*b[k][j];
                }
            }
            return c;
        }
        public long nCrPFermet(int n , int r , long p){
            if(r==0)
                return 1l;
            long fact[] = new long[n+1];
            fact[0] = 1;
            for(int i=1;i<=n;i++)
                fact[i] = (i*fact[i-1])%p;
            long modInverseR = pow(fact[r] , p-2 , 1l , p);
            long modInverseNR = pow(fact[n-r] , p-2 , 1l , p);
            long w = (((fact[n]*modInverseR)%p)*modInverseNR)%p;
            return w;
        }
        public long pow(long a , long b , long res , long mod){
            if(b==0)
                return res;
            if(b==1)
                return (res*a)%mod;
            if(b%2==1){
                res *= a;
                res %= mod;
                b--;
            }
            return pow((a*a)%mod , b/2 , res , mod);
        }
        public long pow(long a , long b , long res){
            if(b == 0)
                return res;
            if(b==1)
                return res*a;
            if(b%2==1){
                res *= a;
                b--;
            }
            return pow(a*a , b/2 , res);
        }
        public void swap(int a[] , int p1 , int p2){
            int x = a[p1];
            a[p1] = a[p2];
            a[p2] = x;
        }
        public void sortedArrayToBST(TreeSet<Integer> a , int start, int end) { 
            if (start > end) {
                return;
            }
            int mid = (start + end) / 2;
            a.add(mid);
            sortedArrayToBST(a, start, mid - 1);
            sortedArrayToBST(a, mid + 1, end); 
        }
        public int lowerLastBound(ArrayList<Long> a , long x){
            int l = 0;
            int r = a.size()-1;
            if(a.get(l)>=x)
                return -1;
            if(a.get(r)<x)
                return r;
            int mid = -1;
            while(l<=r){
                mid = (l+r)/2;
                if(a.get(mid) == x && a.get(mid-1)<x)
                    return mid-1;
                else if(a.get(mid)>=x)
                    r = mid-1;
                else if(a.get(mid)<x && a.get(mid+1)>=x)
                    return mid;
                else if(a.get(mid)<x && a.get(mid+1)<x)
                    l = mid+1;
            }
            return mid;
        }
        public int upperFirstBound(ArrayList<Integer> a , Integer x){
            int l = 0;
            int r = a.size()-1;
            if(a.get(l)>x)
                return l;
            if(a.get(r)<=x)
                return r+1;
            int mid = -1;
            while(l<=r){
                mid = (l+r)/2;
                if(a.get(mid) == x && a.get(mid+1)>x)
                    return mid+1;
                else if(a.get(mid)<=x)
                    l = mid+1;
                else if(a.get(mid)>x && a.get(mid-1)<=x)
                    return mid;
                else if(a.get(mid)>x && a.get(mid-1)>x)
                    r = mid-1;
            }
            return mid;
        }
        public int lowerLastBound(long a[] , long x){
            int l = 0;
            int r = a.length-1;
            if(a[l]>=x)
                return -1;
            if(a[r]<x)
                return r;
            int mid = -1;
            while(l<=r){
                mid = (l+r)/2;
                if(a[mid] == x && a[mid-1]<x)
                    return mid-1;
                else if(a[mid]>=x)
                    r = mid-1;
                else if(a[mid]<x && a[mid+1]>=x)
                    return mid;
                else if(a[mid]<x && a[mid+1]<x)
                    l = mid+1;
            }
            return mid;
        }
        public int upperFirstBound(long a[] , long x , int l){
            // int l = 0;
            int r = a.length-1;
            if(a[l]>x)
                return l;
            if(a[r]<=x)
                return r+1;
            int mid = -1;
            while(l<=r){
                mid = (l+r)/2;
                if(a[mid] == x && a[mid+1]>x)
                    return mid+1;
                else if(a[mid]<=x)
                    l = mid+1;
                else if(a[mid]>x && a[mid-1]<=x)
                    return mid;
                else if(a[mid]>x && a[mid-1]>x)
                    r = mid-1;
            }
            return mid;
        }
        public long log(float number , int base){
            return (long) Math.floor((Math.log(number) / Math.log(base)));
        }
        public long gcd(long a , long b){
            if(a<b){
                long c = b;
                b = a;
                a = c;
            }
            if(a%b==0)
                return b;
            return gcd(b , a%b);
        }
        public void print2d(long a[][] , PrintWriter out){
            for(int i=0;i<a.length;i++){
                for(int j=0;j<a[i].length;j++)
                    out.print(a[i][j] + " ");
                out.println();
            }
            out.println();
        }
        public void print1d(int a[] , PrintWriter out){
            for(int i=0;i<a.length;i++)
                out.print(a[i] + " ");
            out.println();
            out.println();
        }
    }

    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 next() throws IOException { 
            byte[] buf = new byte[64]; // line length 
            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; 
        } 

        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(); 
        } 
    }
}
