#include <bits/stdc++.h>
using namespace std;
int main() {
  long n;
  while (cin >> n) {
    long a[2002] = {0}, b[2002] = {0}, ar[2002] = {0}, k = 1, i;
    for (__typeof(n) i = 0; i < (n); i++) {
      cin >> a[i];
      b[i + 1] = a[i];
    }
    sort(b, b + n + 1);
    for (i = n; i > 0; i--) {
      if (i == n) {
        ar[b[i]] = 1;
        continue;
      }
      if (b[i] == b[i + 1]) {
        ar[b[i]] = ar[b[i + 1]];
        k++;
      } else
        ar[b[i]] = ++k;
    }
    for (__typeof(n) i = 0; i < (n); i++) cout << ar[a[i]] << " ";
  }
  return 0;
}
