Cafeteria#5397

Cafeteria

1 second
64 megabytes
Medium

During this shift, there are so many LKSHe-nya that they can't all fit in the dining hall at once, so they come and go at random times. The deputy head has recorded the arrival and departure times for each LKSHe-nya and wants to determine how many other LKSHe-nya each one encounters in the dining hall.

Input

The first line contains the number of LKSHe-nya, (1 \leq N \leq 10^5). Each of the following lines contains two integers, S_i and T_i (0 \leq S_i \leq T_i \leq 10^9), separated by a space. These represent the arrival and departure times of the -th LKSHe-nya.

Output

The program should output integers. The -th integer should indicate the number of other LKSHe-nya that the -th LKSHe-nya meets in the dining hall. If one LKSHe-nya arrives at the same moment another leaves, they are considered to have met.

Examples

Example 1

Loading
Loading