#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000111;
pair<int, int> tab[MAXN];
int wyn[MAXN];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int a;
    scanf("%d", &a);
    tab[i] = {a, i};
  }
  tab[0] = {1000111000, 0};
  sort(tab + 1, tab + n + 1);
  reverse(tab + 1, tab + n + 1);
  int pop = 0;
  for (int i = 1; i <= n; i++) {
    if (tab[i].first == tab[i - 1].first)
      wyn[tab[i].second] = pop;
    else
      wyn[tab[i].second] = i, pop = i;
  }
  for (int i = 1; i <= n; i++) printf("%d ", wyn[i]);
  puts("");
}
