There are n walruses standing in a queue in an airport. They are numbered starting from the queue's tail: the 1-st walrus stands at the end of the queue and the n-th walrus stands at the beginning of the queue. The i-th walrus has the age equal to ai.

The i-th walrus becomes displeased if there's a younger walrus standing in front of him, that is, if exists such j (i < j), that ai > aj. The displeasure of the i-th walrus is equal to the number of walruses between him and the furthest walrus ahead of him, which is younger than the i-th one. That is, the further that young walrus stands from him, the stronger the displeasure is.

The airport manager asked you to count for each of n walruses in the queue his displeasure.

Input

The first line contains an integer n (2 ≤ n ≤ 105) — the number of walruses in the queue. The second line contains integers ai (1 ≤ ai ≤ 109).

Note that some walruses can have the same age but for the displeasure to emerge the walrus that is closer to the head of the queue needs to be strictly younger than the other one.

Output

Print n numbers: if the i-th walrus is pleased with everything, print "-1" (without the quotes). Otherwise, print the i-th walrus's displeasure: the number of other walruses that stand between him and the furthest from him younger walrus.

Examples

Input

6
10 8 5 3 50 45


Output

2 1 0 -1 0 -1 

Input

7
10 4 6 3 2 8 15


Output

4 2 1 0 -1 -1 -1 

Input

5
10 3 1 10 11


Output

1 0 -1 -1 -1 
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Map.Entry;
import java.util.Queue;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class D {

    public static void main(String[] args) throws IOException {
        InputReader in = new InputReader();
        int n = in.nextInt();
        man[] a = new man[n];
        int[] or = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = new man(in.nextInt(), i);
            or[i] = a[i].age;
        }
        Arrays.sort(a);
        segTree = new int[n];
        int[] tmp = new int[n];
        for (int i = 0; i < a.length; i++)
            tmp[i] = a[i].i;
        createSegTree(tmp);
        StringBuilder ans = new StringBuilder();
        for (int i = 0; i < a.length; i++) {
            int lo = 0, hi = n - 1, mid;
            while (lo < hi) {
                mid = (lo + hi) / 2;
                if (a[mid].age >= or[i])
                    hi = mid;
                else
                    lo = mid + 1;
            }
            if (hi == 0) {
                ans.append(-1 + " ");
            } else {
                int idx = query(0, hi - 1, tmp);
                if (i>=a[idx].i) {
                    ans.append(-1 + " ");
                } else {
                    ans.append( a[idx].i -i- 1 + " ");
                }
            }
        }
        System.out.println(ans);
    }

    static int[] segTree;

    public static void createSegTree(int[] a) {
        int len = (int) (Math.floor((Math.log(a.length) / Math.log(2))) + 1);
        segTree = new int[1 << (len + 1)];
        Arrays.fill(segTree, -1);
        init(1, 0, a.length - 1, a);
    }

    public static void init(int node, int b, int e, int[] a) {
        if (b == e)
            segTree[node] = b;
        else {
            init(2 * node, b, (b + e) / 2, a);
            init(2 * node + 1, (b + e) / 2 + 1, e, a);

            if (a[segTree[2 * node]] > a[segTree[2 * node + 1]])
                segTree[node] = segTree[2 * node];
            else
                segTree[node] = segTree[2 * node + 1];

        }
    }

    public static int query(int i, int j, int[] a) {
        return query(1, i, j, 0, a.length - 1, a);
    }

    public static int query(int node, int i, int j, int L, int R, int[] a) {
        if (i <= L && R <= j)
            return segTree[node];
        if (i > R || L > j)
            return -1;
        int p1 = query(2 * node, i, j, L, (L + R) / 2, a);
        int p2 = query(2 * node + 1, i, j, (L + R) / 2 + 1, R, a);

        if (p1 == -1)
            return p2;
        if (p2 == -1)
            return p1;
        if (a[p1] > a[p2])
            return p1;
        return p2;
    }

    static class man implements Comparable<man> {
        int age;
        int i;

        public man(int age, int i) {
            this.age = age;
            this.i = i;
        }

        @Override
        public String toString() {
            return "man [age=" + age + ", i=" + i + "]";
        }

        @Override
        public int compareTo(man o) {
            if (age == o.age)
                return i - o.i;
            return age - o.age;
        }
    }

    static class InputReader {
        BufferedReader in;
        StringTokenizer st;

        public InputReader() throws IOException {
            in = new BufferedReader(new InputStreamReader(System.in));
            st = new StringTokenizer(in.readLine());
        }

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

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

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