#include <bits/stdc++.h>
using namespace std;
const int N = 1e6;
long long a[N], b[N];
int cnt[N];
int main()
{
ios_base::sync_with_stdio(false);
int n;
cin >> n;
for (int i = 0; i < n; ++i)
cin >> a[i],
b[i] = a[i];
sort(b, b + n);
for (int i = 0; i < n; ++i)
{
cnt[i] = upper_bound(b, b + n, a[i]) - b;
cout << cnt[i] << " ";
}
cout << "\n";
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgpjb25zdCBpbnQgTiA9IDFlNjsKbG9uZyBsb25nIGFbTl0sIGJbTl07CmludCBjbnRbTl07CgppbnQgbWFpbigpCnsKCWlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpOwoJaW50IG47CgljaW4gPj4gbjsKCWZvciAoaW50IGkgPSAwOyBpIDwgbjsgKytpKQoJCWNpbiA+PiBhW2ldLAoJCWJbaV0gPSBhW2ldOwoJc29ydChiLCBiICsgbik7Cglmb3IgKGludCBpID0gMDsgaSA8IG47ICsraSkKCXsKCQljbnRbaV0gPSB1cHBlcl9ib3VuZChiLCBiICsgbiwgYVtpXSkgLSBiOwoJCWNvdXQgPDwgY250W2ldIDw8ICIgIjsKCX0KCWNvdXQgPDwgIlxuIjsKfQ==