#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

double a[100000];
double b[100000];

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int N;
	cin >> N;
	map<double, int> cnt;
	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++) {
		int win = lower_bound(b, b + N, a[i]) - b;
		int draw = (upper_bound(b, b + N, a[i]) - b) - win - 1;
		cout << 3 * win + draw << endl;
	}
}