Public Class Program
  Shared Sub Main()
    Dim n As Integer = Integer.Parse(Console.ReadLine())
    Dim a() As Integer = Array.ConvertAll(Of String, Integer)(Console.ReadLine().Split(" "), AddressOf Integer.Parse)
    Dim output As Integer = a(0)
    For i As Integer = 1 To n - 1
      output = Gcd(output, a(i))
    Next
    Console.WriteLine(output.ToString())
  End Sub
  
  Shared Function Gcd(x As Long, y As Long) As Long
    Return If(x < y, Gcd(y, x), If(y > 0, Gcd(y, x Mod y), x))
  End Function
End Class