#include <bits/stdc++.h>
using namespace std;
struct couple {
  int rating;
  int index;
};
bool sortByRating(const couple &lhs, const couple &rhs) {
  return lhs.rating > rhs.rating;
}
int main() {
  int n;
  scanf("%d", &n);
  couple a[n];
  for (int i = 0; i < n; i++) {
    int rating;
    scanf("%d", &rating);
    a[i].rating = rating;
    a[i].index = i;
  }
  sort(a, a + n, sortByRating);
  int pos = 0;
  int nextpos = 0;
  int positions[n];
  int curr = 10000;
  for (int i = 0; i < n; i++) {
    if (a[i].rating < curr) {
      nextpos++;
      pos = nextpos;
      positions[a[i].index] = pos;
      curr = a[i].rating;
    } else {
      nextpos++;
      positions[a[i].index] = pos;
      curr = a[i].rating;
    }
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", positions[i]);
  }
  printf("\n");
}
