#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int a[3000], cnt[3000], pos[3000];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    cnt[a[i]]++;
  }
  int c = 1;
  for (int i = 2999; i >= 0; i--) {
    if (cnt[i] > 0) {
      pos[i] = c;
      c += cnt[i];
    }
  }
  for (int i = 0; i < n; i++) {
    cout << pos[a[i]] << " ";
  }
  cout << "\n";
}
int main() {
  std::ios::sync_with_stdio(false);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
