The greatest common divisor#571

The greatest common divisor

1 second
128 megabytes
Very easy

Given positive integers, find the greatest common divisor of these numbers.

Input

The first line contains one integer (n \le 1000). The second line contains positive integers, each of which does not exceed 2 \cdot 10^9.

Output

Print the greatest common divisor of the given numbers.

Examples

Example 1

Loading
Loading