#include <bits/stdc++.h>
struct node {
  int num, wh, m;
} s[2020];
int cmp1(node a, node b) { return a.num > b.num; }
int cmp2(node a, node b) { return a.wh < b.wh; }
using namespace std;
int main() {
  int n;
  cin >> n;
  s[0].num = -1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &s[i].num);
    s[i].wh = i;
  }
  sort(s + 1, s + n + 1, cmp1);
  int how = 0, r = 0;
  for (int i = 1; i <= n; i++) {
    if (s[i].num != s[i - 1].num) {
      s[i].m = ++r;
    } else {
      s[i].m = s[i - 1].m;
      r++;
    }
  }
  sort(s + 1, s + 1 + n, cmp2);
  printf("%d", s[1].m);
  for (int i = 2; i <= n; i++) {
    printf(" %d", s[i].m);
  }
  cout << endl;
  return 0;
}
