#include <bits/stdc++.h>
using namespace std;
int N;
struct node {
  int val, pos;
} A[2005];
int res[2005];
int cmp1(node a, node b) { return a.val > b.val; }
int main() {
  A[0].val = 0x7fffffff;
  cin >> N;
  for (int i = 1; i <= N; i++) {
    scanf("%d", &A[i].val);
    A[i].pos = i;
  }
  sort(A + 1, A + 1 + N, cmp1);
  for (int i = 1; i <= N; i++) {
    if (A[i - 1].val == A[i].val)
      res[A[i].pos] = res[A[i - 1].pos];
    else
      res[A[i].pos] = i;
  }
  for (int i = 1; i <= N; i++) printf("%d%c", res[i], i == N ? '\n' : ' ');
  return 0;
}
