<gh_stars>1-10
import sys


def sol():
    input = sys.stdin.readline
    print = sys.stdout.write
    N = int(input())
    raw_data = list(map(int, input().split()))
    sorted_data = list(sorted(set(raw_data)))
    location = {sorted_data[i]: str(i) for i in range(len(sorted_data))}
    print(" ".join([location[i] for i in raw_data]))


if __name__ == "__main__":
    sol()

import sys


def sol():
    input = sys.stdin.readline
    print = sys.stdout.write
    N = int(input())
    raw_data = list(map(int, input().split()))
    sorted_data = list(sorted(set(raw_data)))
    location = {sorted_data[i]: str(i) for i in range(len(sorted_data))}
    print(" ".join([location[i] for i in raw_data]))


if __name__ == "__main__":
    sol()