#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k = 1, i, j, d = 0, c, e;
  cin >> n;
  int a[n], r[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < n; i++) {
    int max = INT_MIN;
    for (j = 0; j < n; j++) {
      if (a[j] >= max) {
        max = a[j];
        c = j;
      }
    }
    if (d == max) {
      r[c] = e;
      k = k + 1;
    } else {
      r[c] = k;
      e = k;
      k++;
    }
    d = max;
    a[c] = 0;
  }
  for (i = 0; i < n; i++) {
    cout << r[i] << " ";
  }
  return 0;
}
