eolymp
bolt
Try our new interface for solving problems
Problems

Peter and the number

Peter and the number

Written on the blackboard \textbf{N} of natural numbers. Peter chooses two random of them and if they are identical, one of them washes, but if they are different, write their difference rather than a larger one. In the end, the board remains one number. What numbers could get Pete after all deletions? \InputFile The first line contains an integer \textbf{N} (\textbf{N} ≤ \textbf{10^5}). he second line contains \textbf{N} integers, separated by a space. All numbers in the input file is guaranteed to fit the type \textbf{Longint}. \OutputFile All of the possible numbers that can get Peter, with a space.
Time limit 1 second
Memory limit 64 MiB
Input example #1
4
1 2 3 3
Output example #1
1