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 x from the table, x is compared with every number y that is not on the table, which includes the other players' hands, your own hand, and the discard pile. If x and y have a common divisor greater than 1, 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.
Each line of the input describes the starting table of one game. The line begins with 1≤n≤1000, followed by n distinct positive integers. Each integer is between 2 and 2×109, and these are the numbers lying on the table when the game starts. The input holds at most 1000 games and ends at end of file.
For each game print the number x that guarantees you win when you pick it, one per line. Every game in the input has exactly one such number.