#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
const long long mxN = 1e6 + 1;
void fileio() {}
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  ;
  map<long long, long long> m;
  for (long long i = n - 1; i >= 0; i--) {
    if (m.find(a[i]) == m.end())
      m[a[i]] = i;
    else
      m[a[i]] = max(m[a[i]], i);
  }
  long long mx = 0;
  for (auto x : m) {
    mx = max(mx, x.second);
    m[x.first] = mx;
  }
  vector<pair<long long, long long> > v;
  for (auto x : m) v.push_back(x);
  vector<long long> res(n, -1);
  for (long long i = 0; i < n; i++) {
    long long j = m[a[i]];
    if (a[j] == a[i]) {
      pair<long long, long long> p = {a[i], 0};
      long long l = lower_bound(v.begin(), v.end(), p) - v.begin();
      l--;
      if (l >= 0) {
        j = v[l].second;
        if (j > i) res[i] = j - i - 1;
      }
    } else if (j > i)
      res[i] = j - i - 1;
  }
  for (long long i = 0; i < res.size(); i++) cout << res[i] << " ";
  cout << "\n";
  ;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  fileio();
  solve();
}
