#include <bits/stdc++.h>
using namespace std;
int n, i, p, r = 1;
vector<pair<int, int> > vec;
int main() {
  cin >> n;
  int ans[n];
  for (i = 0; i < n; i++) {
    cin >> p;
    vec.push_back(make_pair(p, i));
  }
  sort(vec.begin(), vec.end());
  ans[vec[n - 1].second] = 1;
  for (i = n - 2; i >= 0; i--) {
    if (vec[i].first != vec[i + 1].first) r = n - i;
    ans[vec[i].second] = r;
  }
  for (i = 0; i < n; i++) cout << ans[i] << " ";
}
