#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  scanf("%d", &n);
  vector<int> r(n);
  vector<int> idx;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &r[i]);
    idx.push_back(i);
  }
  for (int i = 1; i < n; ++i) {
    int key = r[i];
    int key2 = idx[i];
    int j = i - 1;
    while (j >= 0 && r[j] < key) {
      r[j + 1] = r[j];
      idx[j + 1] = idx[j];
      --j;
    }
    r[j + 1] = key;
    idx[j + 1] = key2;
  }
  vector<int> p{1};
  for (int i = 1; i < n; ++i) {
    if (r[i] == r[i - 1])
      p.push_back(p[i - 1]);
    else
      p.push_back(i + 1);
  }
  for (int i = 1; i < n; ++i) {
    int key = idx[i];
    int key2 = p[i];
    int j = i - 1;
    while (j >= 0 && idx[j] > key) {
      idx[j + 1] = idx[j];
      p[j + 1] = p[j];
      --j;
    }
    idx[j + 1] = key;
    p[j + 1] = key2;
  }
  for (int i = 0; i < n; ++i) printf("%d ", p[i]);
  printf("\n");
  return 0;
}
