#include using namespace std; int64_t gcd(int64_t a, int64_t b){ return b==0 ? a : gcd(b, a%b); } int main(){ int N; cin >> N; int64_t ans = 0; for(int i=0; i> a; if(a > 0) ans = gcd(ans, a); } if(ans == 0){ ans = -1; }else{ ans *= ans; } cout << ans << endl; return 0; }