import java.util.*;

public class Main
{
	public static long gcd(long m, long n)
	{
		if (n != 0)
			return gcd(n, m%n);
		else
			return m;
	}

	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner in = new Scanner(System.in);
		long m = in.nextLong(), n, result = in.nextLong();
		
		for(long i = 2; i <= m; ++i)
		{
			n = in.nextLong();
			result = gcd(result, n);
			if (result == 1) m = 1; //same as break
		}
		System.out.println(result);
	}
}