#include <bits/stdc++.h>
int removeDuplicate(int a[], int size) {
  int prev = 0;
  for (int i = 0; i < size; i++) {
    if (a[i] != a[prev]) a[++prev] = a[i];
  }
  int count = prev + 1;
  return count;
}
using namespace std;
int main() {
  int n, i, j, count, m, p;
  vector<int> v1;
  cin >> n;
  int a[n], b[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    v1.push_back(a[i]);
  }
  sort(a, a + n);
  count = removeDuplicate(a, n);
  m = 1;
  p = 1;
  for (i = count - 1; i >= 0; i--) {
    for (j = 0; j < n; j++) {
      if (a[i] == v1[j]) {
        b[j] = m;
        p++;
      }
    }
    m = p;
  }
  for (i = 0; i < n; i++) cout << b[i] << " ";
}
