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.
/**
 * BaZ :D
 */

import java.lang.reflect.Array;
import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class ACMIND
{
    static FastReader scan;
    static PrintWriter pw;
    static long MOD = 1_000_000_007;
    static long INF = 1_000_000_000_000_000_000L;
    static long inf = 2_000_000_000;
    public static void main(String[] args) {
        new Thread(null,null,"BaZ",1<<27)
        {
            public void run()
            {
                try
                {
                    solve();
                }
                catch(Exception e)
                {
                    e.printStackTrace();
                    System.exit(1);
                }
            }
        }.start();
    }
    static int n, tree[], arr[], tree_min[];
    static void solve() throws IOException
    {
        scan = new FastReader();
        pw = new PrintWriter(System.out,true);
        StringBuilder sb = new StringBuilder();
        n = ni();
        int sz = (int)pow(2, ceil(log(n)/log(2))+1);
        tree = new int[sz];
        tree_min = new int[sz];
        arr = new int[n];
        Pair a[] = new Pair[n];
        for(int i=0;i<n;++i) {
            arr[i] = ni();
            a[i] =  new Pair(arr[i], i);
        }
        Arrays.sort(a);
        build(1, 0, n-1);
        build_min(1, 0, n-1);
        int greater[] = new int[n];
        for(int i=0;i<n;++i) {
            int right = query_index(i+1, n-1, arr[i]+1);
            if(right!=-1) {
                greater[i] = right;
            }
            else {
                greater[i] = query_index(0, i-1, arr[i]+1);
            }
        }
//        pa("a", a);
//        pa("greater", greater);
        int ans[] = new int[n];
        int stop[] = new int[n];
        for(int i=n-1;i>=0;--i) {
            //pl("i: "+i);
            int right = query_index_min(a[i].y+1, n-1, (a[i].x-1)/2);
            if(right!=-1) {
                stop[a[i].y] = right;
            }
            else {
                stop[a[i].y] = query_index_min(0, a[i].y-1, (a[i].x-1)/2);
            }
            //pl("stop: "+stop[a[i].y]);
            if(stop[a[i].y]!=-1) {
                ans[a[i].y] = calc(a[i].y, stop[a[i].y]);
            }
            else {
                ans[a[i].y] = -1;
            }
            if(greater[a[i].y]!=-1 && stop[greater[a[i].y]]!=-1) {
                int ispe = calc(a[i].y, greater[a[i].y]) + ans[greater[a[i].y]];
                if(stop[a[i].y]==-1 || ispe<calc(a[i].y, stop[a[i].y])) {
                    ans[a[i].y] = ispe;
                    stop[a[i].y] = stop[greater[a[i].y]];
                }
            }
        }
        for(int e : ans) {
            p(e);
        }
        pl();
        pw.flush();
        pw.close();
    }
    static class Pair implements Comparable<Pair>
    {
        int x,y;
        Pair(int x,int y)
        {
            this.x=x;
            this.y=y;
        }
        public int compareTo(Pair other)
        {
            if(this.x!=other.x)
                return this.x-other.x;
            return this.y-other.y;
        }
        public String toString()
        {
            return "("+x+","+y+")";
        }
    }
    static int calc(int i, int j) {
        if(j>i) {
            return j-i;
        }
        return (n-(i-j));
    }
    static int query_index(int l, int r, int req) {
        if(l>r || query(l, r)<req) {
            return -1;
        }
        int low = l, high = r, mid,ans = r;
        while(low<=high) {
            mid = (low+high)>>1;
            if(query(l, mid)>=req) {
                ans = mid;
                high = --mid;
            }
            else {
                low = ++mid;
            }
        }
        return ans;
    }
    static int query_index_min(int l, int r, int req) {
        if(l>r || query_min(l, r)>req) {
            return -1;
        }
        int low = l, high = r, mid,ans = r;
        while(low<=high) {
            mid = (low+high)>>1;
            if(query_min(l, mid)<=req) {
                ans = mid;
                high = --mid;
            }
            else {
                low = ++mid;
            }
        }
        return ans;
    }
    static void build(int treein,int low,int high)
    {
        if(low==high)
            tree[treein] = arr[low];
        else
        {
            int mid = (low+high)>>1;
            build(2*treein,low,mid);
            build(2*treein+1,mid+1,high);
            tree[treein] = max(tree[2*treein],tree[2*treein+1]);
        }
    }
    static void build_min(int treein,int low,int high)
    {
        if(low==high)
            tree_min[treein] = arr[low];
        else
        {
            int mid = (low+high)>>1;
            build_min(2*treein,low,mid);
            build_min(2*treein+1,mid+1,high);
            tree_min[treein] = min(tree_min[2*treein],tree_min[2*treein+1]);
        }
    }
    static int query(int treein,int low,int high,int l,int r)
    {
        if(l<=low && high<=r)
            return tree[treein];
        if(low>r || high<l)
            return 0;
        int mid = (low+high)>>1;
        return max(query(2*treein,low,mid,l,r),query(2*treein+1,mid+1,high,l,r));
    }
    static int query_min(int treein,int low,int high,int l,int r)
    {
        if(l<=low && high<=r)
            return tree_min[treein];
        if(low>r || high<l)
            return Integer.MAX_VALUE;
        int mid = (low+high)>>1;
        return min(query_min(2*treein,low,mid,l,r),query_min(2*treein+1,mid+1,high,l,r));
    }
    static int query(int l,int r)
    {
        return query(1,0,n-1,l,r);
    }
    static int query_min(int l,int r)
    {
        return query_min(1,0,n-1,l,r);
    }
    static int ni() throws IOException
    {
        return scan.nextInt();
    }
    static long nl() throws IOException
    {
        return scan.nextLong();
    }
    static double nd() throws IOException
    {
        return scan.nextDouble();
    }
    static void pl()
    {
        pw.println();
    }
    static void p(Object o)
    {
        pw.print(o+" ");
    }
    static void pl(Object o)
    {
        pw.println(o);
    }
    static void psb(StringBuilder sb)
    {
        pw.print(sb);
    }
    static void pa(String arrayName, Object arr[])
    {
        pl(arrayName+" : ");
        for(Object o : arr)
            p(o);
        pl();
    }
    static void pa(String arrayName, int arr[])
    {
        pl(arrayName+" : ");
        for(int o : arr)
            p(o);
        pl();
    }
    static void pa(String arrayName, long arr[])
    {
        pl(arrayName+" : ");
        for(long o : arr)
            p(o);
        pl();
    }
    static void pa(String arrayName, double arr[])
    {
        pl(arrayName+" : ");
        for(double o : arr)
            p(o);
        pl();
    }
    static void pa(String arrayName, char arr[])
    {
        pl(arrayName+" : ");
        for(char o : arr)
            p(o);
        pl();
    }
    static void pa(String listName, List list)
    {
        pl(listName+" : ");
        for(Object o : list)
            p(o);
        pl();
    }
    static void pa(String arrayName, Object[][] arr) {
        pl(arrayName+" : ");
        for(int i=0;i<arr.length;++i) {
            for(Object o : arr[i])
                p(o);
            pl();
        }
    }
    static void pa(String arrayName, int[][] arr) {
        pl(arrayName+" : ");
        for(int i=0;i<arr.length;++i) {
            for(int o : arr[i])
                p(o);
            pl();
        }
    }
    static void pa(String arrayName, long[][] arr) {
        pl(arrayName+" : ");
        for(int i=0;i<arr.length;++i) {
            for(long o : arr[i])
                p(o);
            pl();
        }
    }
    static void pa(String arrayName, char[][] arr) {
        pl(arrayName+" : ");
        for(int i=0;i<arr.length;++i) {
            for(char o : arr[i])
                p(o);
            pl();
        }
    }
    static void pa(String arrayName, double[][] arr) {
        pl(arrayName+" : ");
        for(int i=0;i<arr.length;++i) {
            for(double o : arr[i])
                p(o);
            pl();
        }
    }
    static class FastReader {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

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

        public FastReader(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[1000000];
            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();
        }
    }
}