from sys import stdin, stdout input = lambda: stdin.readline().rstrip() write = stdout.write def main(): N = int(input()) A = stdin.read().splitlines() ans = [0] * N rank = 1 for i, ai in enumerate(A): if A[0] < ai: rank += 1 ans[i] = rank print(*ans, sep='\n') main()