#include<iostream>
#include<cstdio>
using namespace std;
int main(){
	double gpa1[100000],list1[4001]={};
	int N,win[100000]={},list2[4001]={},gpa2[100000];
	cin >> N;
	for(int i=0;i<N;i++){
		scanf("%lf",&gpa1[i]);
	//	cout << gpa1[i]<<"    ";
		gpa1[i]+=0.0001;
		gpa2[i]=gpa1[i]*1000;
	//	cout << gpa2[i] << "\n";
	}
	for(int i=0;i<N;i++){
		if(list1[gpa2[i]]==1){
			win[i]=list2[gpa2[i]];
		}
		else{
			for(int j=0;j<N;j++){
				if(gpa2[i]>gpa2[j])	win[i]+=3;
				else if(gpa2[i]==gpa2[j])	win[i]++;
			}
			
			list1[gpa2[i]]=1;
			list2[gpa2[i]]=win[i];
		}
		cout << (win[i]-1) << "\n";
	}
	return 0;
}