Category

Similar Problems

0717. GCD

Time limit : 1000 ms
Memory limit : 64 mb

   Find the Greatest Common Divisor of n numbers.

Input

   The first line contains the value of n (1 < n < 1001). The second line contains n positive integers, separated with a space. Each number is not greater than 1000000000.

   Output

   The Greatest Common Divisor of n numbers.

Samples

Input

Output

1

2

15 25

5

 

Tayyorladi: Azat Yusupov
Text from: e-olimp.com