#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
static void amax(T &x, U y) {
  if (x < y) x = y;
}
template <typename T, typename U>
static void amin(T &x, U y) {
  if (x > y) x = y;
}
int main() {
  int n, x, cs, sum;
  cs = 1;
  sum = 1;
  scanf("%d", &n);
  vector<int> a, b(2009), c(n);
  for (int i = 0; i < (n); i++) {
    scanf("%d", &x);
    c[i] = x;
    if (!b[x]) a.push_back(x);
    b[x]++;
  }
  sort(a.rbegin(), a.rend());
  for (int i = 0; i < (a.size()); i++) {
    sum += b[a[i]];
    b[a[i]] = cs;
    cs = sum;
  }
  for (int i = 0; i < (n); i++) printf("%d ", b[c[i]]);
  printf("\n");
  return 0;
}
