#include <bits/stdc++.h>
using namespace std;
vector<int> a;
int32_t main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  a.resize(n);
  vector<pair<int, int>> r(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    r[i].first = a[i];
    r[i].second = i;
  }
  sort(r.begin(), r.end());
  vector<int> res(n);
  res[r[0].second] = -1;
  vector<int> trash;
  trash.push_back(r[0].second);
  for (int i = 1; i < n; i++) {
    if (r[i] != r[i - 1]) {
      if (trash.back() < r[i].second)
        res[r[i].second] = -1;
      else
        res[r[i].second] = trash.back() - r[i].second - 1;
      trash.push_back(max(trash.back(), r[i].second));
    } else {
      if (trash.size() == 1)
        res[r[i].second] = -1;
      else {
        int t = res[trash.size() - 2];
        if (t < r[i].second)
          res[r[i].second] = -1;
        else
          res[r[i].second] = t - i - 1;
      }
      trash[trash.size() - 1] = max(trash[trash.size() - 1], r[i].second);
    }
  }
  for (auto x : res) cout << x << " ";
  return 0;
}
