CF1211A.Three Problems

传统题 时间 2000 ms 内存 256 MiB 5 尝试 1 已通过 1 标签

Three Problems

Polycarp is choosing three problems for creating a programming test. Totally he has nn problems in his list. The complexity of the ii-th problem equals rir_i. All problems are numerated from 11 to nn.

Help Polycarp to choose such three problems aa, bb and cc, so that the complexity of the first problem strictly less than the complexity of second problem and the complexity of the second problem is strictly less than the complexity of the third problem. So, for chosen problems aa, bb and cc it should be true that ra<rb<rcr_a \lt r_b \lt r_c.

If Polycarp can choose three problems in different ways, you can print any of them.

Input

The first line of the input contains one integer nn (3n30003 \le n \le 3000) — the number of problems in Polycarp's list.

The second line of the input contains nn integers r1,r2,,rnr_1, r_2, \dots, r_n (1ri1091 \le r_i \le 10^9), where rir_i is the complexity of the ii-th problem.

Output

If Polycarp has no ways to choose three problems, you should print three numbers -1. Ih there is a way to choose them, you should print three different integers a,b,ca, b, c (1a,b,cn1 \le a, b, c \le n), where aa is the number of the first chosen problem, bb is the number of the second chosen problem and cc is the number of the third chosen problem.

Samples

6
3 1 4 1 5 9
4 1 3 
5
1 1000000000 1 1000000000 1
-1 -1 -1
9
10 10 11 10 10 10 10 10 1
9 8 3 

在线编程 IDE

建议全屏模式获得最佳体验