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

public class Main implements Runnable {

	// private class Treap {
	// private class Node {
	// }
	// }

	private class Tree {
		int[] min;
		int[] index;
		int size;

		public Tree(int size) {
			this.size = Integer.highestOneBit(size) * 2;
			min = new int[this.size * 2];
			Arrays.fill(min, Integer.MAX_VALUE);
			index = new int[this.size * 2];
		}

		public void set(int i, int value) {
			i += size;
			min[i] = value;
			index[i] = i - size;
			i /= 2;
			while (i > 0) {
				if (min[2 * i] < min[2 * i + 1]) {
					min[i] = min[2 * i];
					index[i] = index[2 * i];
				} else {
					min[i] = min[2 * i + 1];
					index[i] = index[2 * i + 1];
				}
				i /= 2;
			}
		}

		public int get(int i, int j, int a) {
			return get(1, 0, size - 1, i, j, a);
		}

		private int get(int at, int l, int r, int ql, int qr, int a) {
			if (l == r) {
				if (min[l + size] < a) {
					return l;
				}
				return -1;
			}
			if ((l < ql && r < ql) || (l > qr && r > qr)) {
				return -1;
			}
			if (ql <= l && r <= qr) {
				int lv = min[2 * at];
				int rv = min[2 * at + 1];
				int length = r - l + 1;
				if (rv < a) {
					return get(2 * at + 1, l + length / 2, r, ql, qr, a);
				} else if (lv < a) {
					return get(2 * at, l, l + length / 2 - 1, ql, qr, a);
				} else {
					return -1;
				}
			} else {
				int length = r - l + 1;
				int lv = get(2 * at, l, l + length / 2 - 1, ql, qr, a);
				int rv = get(2 * at + 1, l + length / 2, r, ql, qr, a);
				return Math.max(rv, lv);
			}
		}

		public int get(int i, int j) {
			i += size;
			j += size;
			int minValue = Integer.MAX_VALUE;
			int res = -1;
			while (i <= j) {
				if ((i & 1) != 0) {
					if (min[i] < minValue) {
						minValue = min[i];
						res = index[i];
					}
					++i;
				}
				if ((j & 1) == 0) {
					if (min[j] < minValue) {
						minValue = min[j];
						res = index[j];
					}
					--j;
				}
				i /= 2;
				j /= 2;
			}
			return res;
		}
	}

	private void solution() throws IOException {
		int n = in.nextInt();
		int[] all = new int[n];
		for (int i = 0; i < n; ++i) {
			all[i] = in.nextInt();
		}

		Tree max = new Tree(n);
		for (int i = n - 1; i >= 0; --i) {
			max.set(i, all[i]);
		}

		int[] res = new int[n];
		Arrays.fill(res, -1);

		for (int i = n - 2; i >= 0; --i) {
			int a = max.get(i + 1, n - 1, all[i]);
			if (a >= 0) {
				res[i] = (a - i - 1);
			}
		}

		for (int i = 0; i < n; ++i) {
			if (i != 0) {
				out.print(' ');
			}
			out.print(res[i]);
		}
		out.println();
	}

	private boolean canMake(String a, String b) {
		boolean[] used = new boolean[256];
		for (char c : a.toCharArray()) {
			used[c] = true;
		}
		for (char c : b.toCharArray()) {
			if (!used[c]) {
				return false;
			}
		}
		return true;
	}

	private void debug(Object... o) {
		System.err.println(Arrays.deepToString(o));
	}

	@Override
	public void run() {
		try {
			solution();
			in.reader.close();
			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	private class Scanner {
		StringTokenizer tokenizer;
		BufferedReader reader;

		public Scanner(Reader reader) {
			this.reader = new BufferedReader(reader);
			this.tokenizer = new StringTokenizer("");
		}

		public boolean hasNext() throws IOException {
			while (!tokenizer.hasMoreTokens()) {
				String line = reader.readLine();
				if (line == null) {
					return false;
				}
				tokenizer = new StringTokenizer(line);
			}
			return true;
		}

		public String next() throws IOException {
			hasNext();
			return tokenizer.nextToken();
		}

		public String nextLine() throws IOException {
			tokenizer = new StringTokenizer("");
			return reader.readLine();
		}

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

	public static void main(String[] args) {
		new Thread(null, new Main(), "", 1 << 28).start();
	}

	Scanner in = new Scanner(new InputStreamReader(System.in));
	PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
}