arr = []
for _ in range(int(input())) :
    a, b = map(int,input().split())
    arr.append((a,b))

for tup in arr :
    k=0
    for temp in arr:
        if temp[0]>tup[0] and temp[1]>tup[1] :
            k += 1
    print(k+1,end=" ")
print()