#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int &i : a) cin >> i;
  vector<int> ans(n), st;
  for (int i = n - 1; i >= 0; i--) {
    int l = 0, r = st.size() - 1;
    int tans = st.size();
    while (l <= r) {
      int m = (l + r) / 2;
      if (a[st[m]] < a[i]) {
        tans = min(tans, m);
        r = m - 1;
      } else
        l = m + 1;
    }
    if (tans != st.size())
      ans[i] = st[tans] - i - 1;
    else
      ans[i] = -1;
    st.push_back(i);
    while (st.size() > 1) {
      r = st[st.size() - 1];
      l = st[st.size() - 2];
      if (a[r] >= a[l])
        st.pop_back();
      else
        break;
    }
  }
  for (int i : ans) cout << i << " ";
  cout << endl;
  exit(0);
}
