#include <bits/stdc++.h>
using namespace std;
bool option(int a, int b) { return a > b; }
void Handle(vector<int> &a, vector<int> &b, vector<int> &c, int &n) {
  cin >> n;
  a.resize(n);
  b.resize(n);
  c.resize(2000 + 1);
  for (int i = 0; i < a.size(); i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    b[i] = a[i];
  }
  sort(b.begin(), b.end());
  int count = 0, temp = b.back();
  int rating = 1;
  for (int i = n - 1; i >= 0; i--) {
    if (b[i] == temp) {
      c[temp] = rating;
      count++;
    } else {
      temp = b[i];
      rating = rating + count;
      c[temp] = rating;
      count = 1;
    }
  }
  for (int i = 0; i < n; i++) {
    temp = a[i];
    cout << c[temp] << " ";
  }
  return;
}
int main() {
  vector<int> a, b, c;
  int n;
  Handle(a, b, c, n);
  return 0;
}
