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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author El Mehdi ASSALI
 */
public class Main {
  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    DQueue solver = new DQueue();
    solver.solve(1, in, out);
    out.close();
  }

  static class DQueue {
    int n;
    int k;
    int[] arr;
    int[][] sparse;

    int log2(int n) {
      return Integer.numberOfTrailingZeros(Integer.highestOneBit(n));
    }

    void build() {
      for (int j = 0; j < n; j++) {
        sparse[0][j] = arr[j];
      }
      for (int i = 1; i <= k; i++) {
        for (int j = 0; j + (1 << i) <= n; j++) {
          sparse[i][j] = Math.min(sparse[i - 1][j], sparse[i - 1][j + (1 << (i - 1))]);
        }
      }
    }

    int getMin(int l, int r) {
      int i = log2(r - l + 1);
      return Math.min(sparse[i][l], sparse[i][r - (1 << i) + 1]);
    }

    public void solve(int testNumber, InputReader in, PrintWriter out) {
      n = in.nextInt();
      k = log2(n);
      arr = new int[n];
      sparse = new int[k + 1][n];
      for (int i = 0; i < n; i++) {
        arr[i] = in.nextInt();
      }
      build();
      for (int i = 0; i < n; i++) {
        int l = i + 1, r = n - 1, ans = -1;
        while (l <= r) {
          int m = (l + r) >> 1;
          int min = getMin(m, r);
          if (min < arr[i]) {
            ans = m;
            l = m + 1;
          } else {
            r = m - 1;
          }
        }
        out.print((ans == -1 ? ans : ans - i - 1) + " ");
      }
    }

  }

  static class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream inputStream) {
      reader = new BufferedReader(new InputStreamReader(inputStream));
    }

    public String next() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
      return tokenizer.nextToken();
    }

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

  }
}

