#include <bits/stdc++.h>
using namespace std;
long long a[1234567], b[20002], final[100002];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b, b + n);
  int pos = 1;
  final[b[n - 1]] = 1;
  for (int i = n - 2; i >= 0; i--) {
    if (b[i] == b[i + 1]) {
      final[b[i]] = final[b[i + 1]];
      pos++;
    } else {
      final[b[i]] = pos + 1;
      pos++;
    }
  }
  for (int i = 0; i < n; ++i) {
    cout << final[a[i]] << " ";
  }
  return 0;
}
