#include <bits/stdc++.h>
using namespace std;
multiset<pair<int, int> > m;
int ans[1000000];
int a[1000000];
int main() {
  int n;
  cin >> n;
  memset(ans, -1, sizeof(ans));
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    m.insert(pair<int, int>(a[i], i));
  }
  for (int i = n - 1; i >= 0; i--) {
    if (m.find(pair<int, int>(a[i], i)) == m.end()) continue;
    m.erase(m.find(pair<int, int>(a[i], i)));
    multiset<pair<int, int> >::iterator it = m.end();
    if (m.empty()) break;
    --it;
    pair<int, int> now = *it;
    while (now.first > a[i] && !m.empty()) {
      ans[now.second] = i - now.second - 1;
      m.erase(--m.end());
      if (m.empty()) break;
      it = m.end();
      --it;
      now = *it;
    }
  }
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  cout << endl;
}
