#P430. 【例75.1】 坐标统计

【例75.1】 坐标统计

Description

Given nn points on a plane (both xx and yy coordinates are integers), for each point, it can "control" all points that are strictly to its lower left (i.e., both xx and yy coordinates are less than its own). The number of points it can control is called its "combat power". Output the combat power for each point in order, and finally output the index of the point with the highest combat power (if there are multiple points with the same highest combat power, output the largest index among them).

Input Format

The first line contains a positive integer nn (1n1001≤n≤100); the next nn lines each describe the coordinates of a point. The (i+1)(i+1)-th line contains two positive integers xx and yy (1x,y10001≤x,y≤1000), indicating that the point with index ii has coordinates (x,y)(x, y).

Output Format

Output n+1n+1 lines. Lines 11 to nn each contain an integer, where the ii-th line is the combat power of the point with index ii. The (n+1)(n+1)-th line contains the index of the point with the highest combat power (if there are multiple, output the largest index).

Sample

6
4 2
6 6
4 8
15 6
11 9
8 14
0
1
0
1
3
3
6