Shoemaker Problem#1591

Shoemaker Problem

1 second
128 megabytes
Very easy

A shoemaker needs to complete jobs. Each day, the shoemaker can work on only one job. For each -th job, the time required to finish it in days, T_i, and the fine the shoemaker must pay each day until he delivers the -th job to the customer, S_i, are both known. Find the order of doing the jobs that minimizes the total fine amount.

Input

The input consists of multiple tests. The first line of each test contains the number of jobs (1 \leq n \leq 1000), followed by lines containing the characteristics of the jobs: T_i (1 \leq T_i \leq 1000) and S_i (1 \leq S_i \leq 10000).

Output

For each test, print on a separate line the sequence of job numbers that minimizes the total fine. If there are several optimal job sequences, print the lexicographically smallest one.

Examples

Example 1

Loading
Loading