#include <iostream>
#include <algorithm>
using namespace std;

int main(){
    int N;
    cin>>N;
    double A[N],A2[N];
    for(int i=0;i<N;i++){
        cin>>A[i];
        A2[i]=A[i];
    }
    sort(A2, A2+N);
    for(int i=0;i<N;i++){
        auto lb=lower_bound(A2, A2+N,A[i]);
        auto ub=upper_bound(A2, A2+N,A[i]);
        int win = lb-A2;
        int even = ub-A2-win;
        int lose=N-win-even;
        cout<<win*3+even-1<<endl;
    }

    return 0;
}