#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void checkmin(T &a, T b) {
  if (a > b) a = b;
}
template <class T>
inline void checkmax(T &a, T b) {
  if (a < b) a = b;
}
const int oo = 1 << 30;
const double eps = 1e-7;
const int N = 1 << 20;
const int M = 1;
const long long P = 10000000097ll;
int in[N], to[N], tn;
int n;
int tr[N];
int out[N];
void read() {
  int i;
  for ((i) = 0; i < (n); (i)++) scanf("%d", &in[i]);
  for ((i) = 0; i < (n); (i)++) to[i] = in[i];
  sort(to, to + n);
  tn = unique(to, to + n) - to;
  for ((i) = 0; i < (n); (i)++)
    in[i] = lower_bound(to, to + tn, in[i]) - to + 1;
}
void init(int x, int k) {
  for (; x < tn && tr[x] > k; x += x & -x) tr[x] = k;
}
int find(int x) {
  int ans = oo;
  for (; x > 0; x -= x & -x) checkmin(ans, tr[x]);
  return ans;
}
void doit() {
  int i, j, k;
  int t;
  (memset((tr), 0x7f, sizeof(tr)));
  for ((i) = 0; i < (n); (i)++) {
    k = find(in[i] - 1);
    init(in[i], i);
    if (k < N)
      out[i] = i - k - 1;
    else
      out[i] = -1;
  }
}
void pt() {
  int i, j, k;
  printf("%d", out[0]);
  for (i = 1; i < n; i++) printf(" %d", out[i]);
  puts("");
}
int main() {
  int T, _ = 0;
  while (1 == scanf("%d", &n)) {
    read();
    reverse(in, in + n);
    doit();
    reverse(out, out + n);
    pt();
  }
  return 0;
}
