#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, tmp[3123], rat[3123] = {0}, ar[3123];
  vector<int> rank;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &tmp[i]);
    rat[tmp[i]]++;
    rank.push_back(tmp[i]);
  }
  sort(rank.begin(), rank.end());
  int mak = rank.size() - 1;
  int rankno = 1;
  ar[rank[mak]] = 1;
  for (int i = mak - 1; i >= 0; i--) {
    if (rank[i + 1] == rank[i]) {
      rankno++;
    } else {
      rankno++;
      ar[rank[i]] = rankno;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (i != n)
      printf("%d ", ar[tmp[i]]);
    else
      printf("%d", ar[tmp[i]]);
  }
  return 0;
}
