#include <bits/stdc++.h>
using namespace std;
const int N = int(2e5);
int n;
pair<int, int> a[N];
int ans[N];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a + 1, a + n + 1);
  reverse(a + 1, a + n + 1);
  int k = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i].first != a[i - 1].first) {
      ans[a[i].second] = i;
      k = i;
    } else {
      ans[a[i].second] = k;
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
