#include <stdio.h>
#include <algorithm>
#include <utility>
using namespace std;

int main(void) {
  int i, j, k, n;
  scanf("%d", &n);
  pair<float, int> a[n];
  int ans[n];
  for(i = 0; i < n; ++i) {
    scanf("%f", &a[i].first);
    a[i].second = i;
  }
  sort(a, a + n);
  for(i = 0; i < n; ++i) {
    pair<float, int> p1 = make_pair(a[i].first, 0), p2 = make_pair(a[i].first, 1000000);
    ans[a[i].second] = (lower_bound(a, a + n, p1) - a) * 3 + ((a + i) - lower_bound(a, a + n, p1)) + (upper_bound(a, a + n, p2) - (a + i + 1)); 
  }
  for(i = 0; i < n; ++i) printf("%d\n", ans[i]);
  return 0;
}
