#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n], i;
  pair<int, int> p[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    p[i].first = a[i], p[i].second = i;
  }
  sort(p, p + n);
  int l = 1;
  a[p[n - 1].second] = 1;
  for (i = n - 2; i >= 0; i--) {
    if (p[i].first == p[i + 1].first)
      a[p[i].second] = l;
    else {
      a[p[i].second] = l = n - i;
    }
  }
  for (i = 0; i < n; i++) cout << a[i] << ' ';
  return 0;
}
