Under construction

Still being built. Things may change

Which Team Should Receive the Sponsor Prize?

Time limit8sMemory limit1024 MB

Summary
For each dataset, find the team whose elapsed time is closest to 2023 seconds and print its team number.
Level

Easy2 of 10

Topics
Implementation, Array
Solved
No attempts yet

Problem

In ICQC (International Collegiate Quiz Contest), teams compete on how fast they can answer a difficult quiz. The winner is, of course, the team that gives the correct answer first. This year, a sponsor prize also goes to the team whose correct answer time is closest to 20232023 seconds after the contest starts.

Given the elapsed time from the start of the contest until each team gave its correct answer, decide which team receives the sponsor prize.

Input

The input consists of multiple datasets. Each dataset is given in the following format. There are at most 5050 datasets.

nn a1a_1 a2a_2 ⋯\cdots ana_n

nn is the number of participating teams, where 2≤n≤1002 \le n \le 100. The teams are numbered 11 through nn. aka_k (k=1,…,nk = 1, \ldots, n) is the elapsed time in seconds before team kk gave its correct answer. It is a positive integer not exceeding 10410^4. You may assume that exactly one team has the elapsed time closest to 20232023 seconds.

The end of the input is a line containing a single 00.

Output

For each dataset, print the number of the team that receives the sponsor prize on its own line.

Examples1

  1. Example 1

    Input
    2
    123 4567
    3
    2024 2020 2023
    5
    2020 2020 2021 2024 2026
    3
    1599 2222 1599
    8
    2 2 3 3 4 4 5 1
    4
    7777 6666 8888 9999
    0
    
    Expected output
    1
    3
    4
    2
    7
    2