#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<double,int> DI;
const int MAX_N = (int)1e5 + 5;

bool cmp(P a, P b){
	return a.second < b.second;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int N; cin >> N;
	vector<DI> a(N);
	rep (i, N){
		double g; cin >> g;
		a[i].first = -g;
		a[i].second = i;
	} // end rep
	sort(ALL(a));
	vector<P> rank(N);
	vector<int> same(N + 1, 1);		// ??????????????°???????´??????????

	rank[0].first = 0;
	rank[0].second = a[0].second;	// ???????????????????´?
	for (int i = 1; i < N; ++i){
		rank[i].second = a[i].second;
		if (a[i-1].first == a[i].first){ // ??????
			rank[i].first = rank[i-1].first;
			same[i] = same[i-1] + 1;
		}else{
			rank[i].first = i;
		} // end if
	} // end for

	for (int r = 0; r < N; ++r){
		if (same[r] != 1){
			int l = r;
			for (; same[l] != 1; ++l);
			
			for (int m = r - 1; m < l; ++m){
				same[m] = same[l-1];	
			} // end for
		} // end if
	} // end for
	

	vector<P> res(N);
	rep (i, N){
		res[i].second = rank[i].second;
		if (same[i] == 1){	// ??????????????????
			res[i].first = 3 * (N - 1 - rank[i].first);
		}else{	// ??????????????¨??????
			int curr = (same[i] - 1); // ?????????????????????
			res[i].first = 1 * (same[i] - 1) + 3 * (N - rank[i].first - same[i]);
		} // end if
	} // end rep

	sort(ALL(res), cmp);

	rep (i, N){
		cout << res[i].first << endl;
	} // end rep
	
	return 0;
}