/*  -*- coding: utf-8 -*-
 *
 * 3001.cc: 
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 100000;

/* typedef */

/* global variables */

double as[MAX_N], bs[MAX_N];

/* subroutines */

/* main */

int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", as + i), bs[i] = as[i];
  sort(bs, bs + n);

  for (int i = 0; i < n; i++) {
    int k0 = lower_bound(bs, bs + n, as[i]) - bs;
    int k1 = upper_bound(bs, bs + n, as[i]) - bs;
    int sc = k0 * 3 + (k1 - k0) - 1;
    printf("%d\n", sc);
  }
  return 0;
}

