#include using namespace std; long maximumValue(vector a) { // Return the maximum value of f among all subsegments [l..r]. return(gcd(for(int l=0;l<=r;l++){a[l];})) } int main() { int n; cin >> n; vector a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } long result = maximumValue(a); cout << result << endl; return 0; }