#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.14159265358979323846;
const int inf = (int)1e9;
const long double eps = 1e-9;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  int num = 1;
  vector<int> res(n);
  for (int i = 0; i < n; ++i) {
    num = i + 1;
    int j = i;
    while (j < n && a[j].first == a[i].first) {
      res[a[j].second] = num;
      ++j;
    }
    i = j - 1;
  }
  for (int i = 0; i < n; ++i) {
    cout << res[i] << " ";
  }
  return 0;
}
