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.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * @author Ivan Pryvalov (ivan.pryvalov@gmail.com)
 * 
 */
public class D implements Runnable {

	static class Data {
		int pos, a, c = -2;

		@Override
		public String toString() {
			return "Data [pos=" + pos + ", a=" + a + ", c=" + c + "]";
		}
	}

	private void solve() throws Exception {
		int N = nextInt();
		Data data[] = new Data[N];
		Data dataAge[] = new Data[N];
		for (int i = 0; i < N; i++) {
			Data d = new Data();
			d.a = nextInt();
			d.pos = i;
			data[i] = d;
			dataAge[i] = d;
		}

		//
		Arrays.sort(dataAge, new Comparator<Data>() {
			@Override
			public int compare(Data o1, Data o2) {
				if (o1.a!=o2.a) return -(o1.a - o2.a);
				return -(o1.pos-o2.pos);
			}
		});


		int pos = dataAge.length-1;
		for (int i = 0; i < dataAge.length; ) {
			int j=i;
			for (;j<dataAge.length && dataAge[j].a == dataAge[i].a;j++){
				if (dataAge[j].pos==pos){
					dataAge[j].c = -1;
					while (pos>=0 && data[pos].c!=-2)
						pos--;
				}else{
					dataAge[j].c = pos - dataAge[j].pos - 1;
				}
			}
			i=j;
		}

		for (int i = 0; i < dataAge.length; i++) {
			out.print(data[i].c);
			out.print(' ');
		}
		out.println();
	}

	// ///////////////////////////////////////////////
	boolean inputFromFile = false;
	String filenamePrefix = "A-small-attempt0";
	String inSuffix = ".in";
	String outSuffix = ".out";

	BufferedInputStream bis;
	BufferedOutputStream bos;
	PrintStream out;

	final static byte ZERO = '0';// 48 or 0x30
	final static byte NINE = '9';
	final static byte SPACEBAR = ' '; // 32 or 0x20
	final static byte MINUS = '-'; // 45 or 0x2d

	final static char FLOAT_POINT = '.';

	@Override
	public void run() {
		try {
			if (inputFromFile) {
				File baseFile = new File(getClass().getResource("/").getFile());
				bis = new BufferedInputStream(new FileInputStream(new File(
						baseFile, filenamePrefix + inSuffix)),
						INPUT_BUFFER_SIZE);
				bos = new BufferedOutputStream(new FileOutputStream(new File(
						baseFile, filenamePrefix + outSuffix)));
				out = new PrintStream(bos);
			} else {
				bis = new BufferedInputStream(System.in, INPUT_BUFFER_SIZE);
				bos = new BufferedOutputStream(System.out);
				out = new PrintStream(bos);
			}
			solve();
			out.flush();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	final int INPUT_BUFFER_SIZE = 1024 * 1024 * 8;
	final int BUF_SIZE_INPUT = INPUT_BUFFER_SIZE;
	final int BUF_SIZE = 1024;
	byte[] byteBufInput = new byte[BUF_SIZE_INPUT];
	byte by = -1;
	int byteRead = -1;
	int bytePos = -1;

	byte[] byteBuf = new byte[BUF_SIZE];
	int totalBytes;

	private byte nextByte() throws IOException {
		if (bytePos < 0 || bytePos >= byteRead) {
			byteRead = bis.read(byteBufInput);
			bytePos = 0;
			if (byteRead < 0)
				byteBufInput[bytePos] = 0;// !!!
		}
		return byteBufInput[bytePos++];
	}

	public void writeUnsignedInt(int num) throws IOException {
		int byteWriteOffset = byteBuf.length;
		if (num == 0) {
			byteBuf[--byteWriteOffset] = ZERO;
		} else {
			while (num > 0) {
				byteBuf[--byteWriteOffset] = (byte) ((num % 10) + ZERO);
				num /= 10;
			}
		}
		bos.write(byteBuf, byteWriteOffset, byteBuf.length - byteWriteOffset);
	}

	public void writeInt(int num) throws IOException {
		int byteWriteOffset = byteBuf.length;
		boolean minus = false;
		if (num < 0) {
			minus = true;
			num = -num;
		}
		if (num == 0) {
			byteBuf[--byteWriteOffset] = ZERO;
		} else {
			while (num > 0) {
				byteBuf[--byteWriteOffset] = (byte) ((num % 10) + ZERO);
				num /= 10;
			}
			if (minus) {
				byteBuf[--byteWriteOffset] = MINUS;
			}
		}
		bos.write(byteBuf, byteWriteOffset, byteBuf.length - byteWriteOffset);
	}

	public void writeSpaceBar() throws IOException {
		byteBuf[0] = SPACEBAR;
		bos.write(byteBuf, 0, 1);
	}

	/*
	 * //TODO test Unix/Windows formats public void toNextLine() throws
	 * IOException{ while ((ch=nextChar())!='\n'); }
	 * 
	 * //[0-9.-] eE? public double nextDouble() throws IOException{ while
	 * (((ch=nextChar())<'0' || ch>'9') && ch!=FLOAT_POINT && ch!='-'); char[]
	 * tmp = new char[255]; int itmp = 0; tmp[itmp++]=(char)ch; while
	 * (((ch=nextChar())>='0' && ch<='9') || ch==FLOAT_POINT || ch=='-'){
	 * tmp[itmp++]=(char)ch; } return Double.parseDouble(new
	 * String(tmp,0,itmp)); }
	 */

	/**
	 * Returns next meaningful character as a byte.<br>
	 * 
	 * @return
	 * @throws IOException
	 */
	public byte nextChar() throws IOException {
		while ((by = nextByte()) <= 0x20)
			;
		return by;
	}

	/**
	 * Returns next meaningful character OR space as a byte.<br>
	 * 
	 * @return
	 * @throws IOException
	 */
	public byte nextCharOrSpacebar() throws IOException {
		while ((by = nextByte()) < 0x20)
			;
		return by;
	}

	/**
	 * Spacebar is included as separator char
	 * 
	 * @throws IOException
	 */
	private void readToken() throws IOException {
		readToken((byte) 0x21);
	}

	/**
	 * Reads line.
	 * 
	 * @return
	 * @throws IOException
	 */
	public String nextLine() throws IOException {
		readToken((byte) 0x20);
		return new String(byteBuf, 0, totalBytes);
	}

	/**
	 * Reads token. Spacebar is separator char.
	 * 
	 * @return
	 * @throws IOException
	 */
	public String nextToken() throws IOException {
		readToken((byte) 0x21);
		return new String(byteBuf, 0, totalBytes);
	}

	private void readToken(byte acceptFrom) throws IOException {
		totalBytes = 0;
		while ((by = nextByte()) < acceptFrom)
			;
		byteBuf[totalBytes++] = by;
		while ((by = nextByte()) >= acceptFrom) {
			byteBuf[totalBytes++] = by;
		}
	}

	public int nextInt() throws IOException {
		readToken();
		int num = 0, i = 0;
		boolean sign = false;
		if (byteBuf[i] == MINUS) {
			sign = true;
			i++;
		}
		for (; i < totalBytes; i++) {
			num *= 10;
			num += byteBuf[i] - ZERO;
		}
		return sign ? -num : num;
	}

	public long nextLong() throws IOException {
		readToken();
		long num = 0;
		int i = 0;
		boolean sign = false;
		if (byteBuf[i] == MINUS) {
			sign = true;
			i++;
		}
		for (; i < totalBytes; i++) {
			num *= 10;
			num += byteBuf[i] - ZERO;
		}
		return sign ? -num : num;
	}

	public static void main(String[] args) {
		new D().run();
	}

}
