Choosing Numbers

No attempts yetTime limit2sMemory limit256 MB

Problem

You play a game with friends often, and you keep losing. Whoever holds the largest number at the end wins. When a game starts, a set of distinct numbers lies on the table. On your turn you pick one number from the table and take it into your hand. Sometimes a number in your hand has to be thrown away.

While the game runs, every number sits in one of three places: on the table, in some player's hand, or in the discard pile. When a player picks the number xx from the table, xx is compared with every number yy that is not on the table, which includes the other players' hands, your own hand, and the discard pile. If xx and yy have a common divisor greater than 11, both numbers move to the discard pile, and a number already in the discard pile stays there. The game ends once every number has been taken from the table.

Given the numbers on the table, find the number that wins the game for you when you pick it.

Input

Each line of the input describes the starting table of one game. The line begins with 1n10001 \le n \le 1000, followed by nn distinct positive integers. Each integer is between 22 and 2×1092 \times 10^9, and these are the numbers lying on the table when the game starts. The input holds at most 10001000 games and ends at end of file.

Output

For each game print the number xx that guarantees you win when you pick it, one per line. Every game in the input has exactly one such number.