#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(void)
{
int n;
cin >> n; //원소의 갯수 입력
vector <int> v(n); //원소의 갯수만큼 백터 할당
for (int i = 0; i < n; i++)
cin >> v[i]; //원소 값 입력
vector <int> r(v); //기존의 백터 v 복사
sort(r.begin(), r.end()); //오름차순으로 정렬
r.erase(unique(r.begin(), r.end()), r.end()); //중복 제거
for (int i = 0; i < n; i++)
{
auto it = lower_bound(r.begin(), r.end(), v[i]); //입력순으로 입력값 위치 탐색
cout << it - r.begin() << " ";
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8dmVjdG9yPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKHZvaWQpCnsKCWludCBuOwoJY2luID4+IG47CS8v7JuQ7IaM7J2YIOqwr+yImCDsnoXroKUKCgl2ZWN0b3IgPGludD4gdihuKTsJCQkvL+ybkOyGjOydmCDqsK/siJjrp4ztgbwg67Cx7YSwIO2VoOuLuSAKCWZvciAoaW50IGkgPSAwOyBpIDwgbjsgaSsrKQoJCWNpbiA+PiB2W2ldOwkJCS8v7JuQ7IaMIOqwkiDsnoXroKUKCgl2ZWN0b3IgPGludD4gcih2KTsJCQkvL+q4sOyhtOydmCDrsLHthLAgdiDrs7XsgqwKCXNvcnQoci5iZWdpbigpLCByLmVuZCgpKTsJLy/smKTrpoTssKjsiJzsnLzroZwg7KCV66CsCglyLmVyYXNlKHVuaXF1ZShyLmJlZ2luKCksIHIuZW5kKCkpLCByLmVuZCgpKTsJCQkvL+ykkeuztSDsoJzqsbAKCglmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykKCXsKCQlhdXRvIGl0ID0gbG93ZXJfYm91bmQoci5iZWdpbigpLCByLmVuZCgpLCB2W2ldKTsJLy/snoXroKXsiJzsnLzroZwg7J6F66Cl6rCSIOychOy5mCDtg5Dsg4kKCQljb3V0IDw8IGl0IC0gci5iZWdpbigpIDw8ICIgIjsKCX0KfQ==