Under construction

Still being built. Things may change

Circus Performance

Time limit1sMemory limit1024 MB

Summary
Given n acrobats with heights and weights, output an order so every three consecutive acrobats have forward stunt efficiency at least the reverse efficiency.
Level

Medium6 of 10

Topics
Geometry, Sorting
Solved
No attempts yet

Problem

There is a very famous circus in the city! The circus has exactly nn acrobats, and this time they prepared a special show in honor of the SPb Team School Programming Olympiad 2022.

The ii-th acrobat has height aia_i and weight bib_i. Any three acrobats can get together and perform an unusual stunt. If acrobats ii, jj, and kk perform a stunt, the efficiency of the stunt is aibj+ajbk+akbia_i b_j + a_j b_k + a_k b_i.

The trainer considers an ordered trio of acrobats (i,j,k)(i, j, k) good if the efficiency of their stunt is no less than the efficiency when they perform in reverse order (k,j,i)(k, j, i).

For the final act, the trainer wants to line up all nn acrobats so that every triple of consecutive acrobats is good. Help him with this difficult task!

Input

The first line contains an integer nn, the number of acrobats (3≤n≤10003 \leq n \leq 1000).

Each of the following nn lines contains two space-separated integers aia_i and bib_i, the height and weight of the ii-th acrobat (1≤ai,bi≤1091 \leq a_i, b_i \leq 10^9).

Output

Print nn different integers from 11 to nn, the numbers of the acrobats in the order in which they should be lined up.

Examples2

  1. Example 1

    Input
    3
    10 70
    30 40
    50 60
    
    Expected output
    2 3 1
    
  2. Example 2

    Input
    4
    99 99
    11 11
    88 88
    55 55
    
    Expected output
    2 4 3 1