#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > str;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    str.push_back(make_pair(x, i));
  }
  sort(str.begin(), str.end(), greater<pair<int, int> >());
  vector<int> ret(n);
  int cnt = 1, prev, fl = 0;
  for (int i = 0; i < str.size(); i++) {
    if (i == 0) {
      ret[str[i].second] = cnt;
      prev = str[i].first;
    } else if (prev == str[i].first) {
      ret[str[i].second] = cnt;
      fl++;
    } else {
      cnt += fl + 1;
      fl = 0;
      ret[str[i].second] = cnt;
      prev = str[i].first;
    }
  }
  for (int i = 0; i < n; i++) cout << ret[i] << " ";
  cout << endl;
  return 0;
}
