B - Trifecta Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MiB

配点 : 200

問題文

1 から N の番号がついた N 頭の馬が競争をしました。

全ての馬は同時にスタートし、 i 番の馬はスタートからゴールまで T_i 秒かかりました。

1,2,3 着の馬の番号を求めてください。なお、 T_i は相異なることが保証されます。

制約

  • 3\leq N \leq 32
  • 1\leq T_i \leq 200
  • T_i は相異なる
  • 入力は全て整数

入力

入力は以下の形式で標準入力から与えられる。

N
T_1 \dots T_N

出力

1,2,3 着の馬の番号をそれぞれ空白区切りでこの順に出力せよ。


入力例 1

4
100 110 105 95

出力例 1

4 1 3

4,1,3,2 番の順にゴールしました。1,2,3 着の番号である 4,1,3 をこの順に空白区切りで出力してください。


入力例 2

8
72 74 69 70 73 75 71 77

出力例 2

3 4 7

Score : 200 points

Problem Statement

N horses numbered 1 to N had a race.

All horses started simultaneously, and horse i took T_i seconds from the start to the goal.

Find the numbers of the horses that finished in 1st, 2nd, and 3rd places. It is guaranteed that all T_i are distinct.

Constraints

  • 3\leq N \leq 32
  • 1\leq T_i \leq 200
  • All T_i are distinct.
  • All input values are integers.

Input

The input is given from Standard Input in the following format:

N
T_1 \dots T_N

Output

Output the numbers of the horses that finished in 1st, 2nd, and 3rd places, in this order, separated by spaces.


Sample Input 1

4
100 110 105 95

Sample Output 1

4 1 3

The horses finished in the order 4, 1, 3, 2. Output the numbers for 1st, 2nd, and 3rd places, which are 4, 1, 3, in this order, separated by spaces.


Sample Input 2

8
72 74 69 70 73 75 71 77

Sample Output 2

3 4 7