#include <bits/stdc++.h>
using namespace std;
int n;
int bit[1000001];
void update(int pos)
{
while(pos<=n)
{
bit[pos]++;
pos= pos + (pos & -pos);
}
}
int getsum(int pos)
{
int sum=0;
while(pos>0)
{
sum+=bit[pos];
pos= pos - (pos & -pos);
}
return sum;
}
int main()
{
ios_base::sync_with_stdio(false);
cin>>n;
vector<long long> a;
int temp;
for(temp=0;temp<n;temp++)
{
long long x;
cin>>x;
a.push_back(x);
}
vector<long long> b(a);
sort(b.begin(),b.end());
for(temp=0;temp<n;temp++)
{
a[temp]=lower_bound(b.begin(),b.end(),a[temp])-b.begin()+1;
update(a[temp]);
}
int cnt[n];
for(temp=0;temp<n;temp++)
{
cnt[temp]=getsum(a[temp]);
cout<<cnt[temp]<<" ";
}
cout<<"\n";
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmludCBuOwppbnQgYml0WzEwMDAwMDFdOwoKdm9pZCB1cGRhdGUoaW50IHBvcykKewoJd2hpbGUocG9zPD1uKQoJewoJCWJpdFtwb3NdKys7CgkJcG9zPSBwb3MgKyAocG9zICYgLXBvcyk7Cgl9Cn0KCmludCBnZXRzdW0oaW50IHBvcykKewoJaW50IHN1bT0wOwoJd2hpbGUocG9zPjApCgl7CgkJc3VtKz1iaXRbcG9zXTsKCQlwb3M9IHBvcyAtIChwb3MgJiAtcG9zKTsKCX0KCXJldHVybiBzdW07Cn0KCmludCBtYWluKCkKewoJaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7CgljaW4+Pm47Cgl2ZWN0b3I8bG9uZyBsb25nPiBhOwoJaW50IHRlbXA7Cglmb3IodGVtcD0wO3RlbXA8bjt0ZW1wKyspCgl7CgkJbG9uZyBsb25nIHg7CgkJY2luPj54OwoJCWEucHVzaF9iYWNrKHgpOwoJfQoJCgl2ZWN0b3I8bG9uZyBsb25nPiBiKGEpOwoJCglzb3J0KGIuYmVnaW4oKSxiLmVuZ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