#include <bits/stdc++.h>
using namespace std;
struct stra {
  int x, y, z;
} arr[100000];
bool cmp(stra a, stra b) { return a.x > b.x; }
bool cmp1(stra a, stra b) { return a.y < b.y; }
int n, k = 1, g = 1;
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i <= n - 1; i++) {
    cin >> arr[i].x;
    arr[i].y = i;
  }
  sort(arr, arr + n, cmp);
  arr[0].z = 1;
  for (int i = 1; i <= n - 1; i++) {
    if (arr[i - 1].x != arr[i].x) {
      k = i + 1;
      arr[i].z = k;
    } else {
      arr[i].z = k;
    }
  }
  sort(arr, arr + n, cmp1);
  for (int i = 0; i <= n - 1; i++) {
    cout << arr[i].z << " ";
  }
}
