The Easiest Way

As a participant in the Programming Olympiads in Murcia, your purpose is to win as many paper birds as possible. But this year the problems are so difficult... So you decide to take the easiest way: to make the paper birds yourself. You want to make 4 paper birds of the same size, pretending that you have solved 4 problems –thus classifying for SWERC’2007–. N rectangular pieces of paper of different sizes are available. Each piece of paper, i, has width wi and height hi. Your task is to select one piece in order to maximize the size of the 4 birds. You have to take into account that, to make a bird, a square piece of paper is needed. The paper can be cut off, but not glued. If more than one optimum piece of paper is possible, you have to indicate the first one. Input The input may contain several test cases. For each test case, the first line indicates the number of pieces of paper, N. The following N lines contain the sizes of the pieces of paper; each line contains two integers: wi and hi. The input ends with a case where N = 0. Output For each test case (except for the case with N = 0), the output should consist of an integer indicating the number of the piece to make the biggest paper birds. The first piece is 1, the second is 2, and so on. If many solutions are possible, output the first one. Sample Input 3 10 20 40 8 12 12 3 140 122 122 140 100 170 2 120 170 71 500 0 Sample Output 2 1 2