#include using namespace std; int gcd(int a, int b) { int r = a % b; return r ? gcd(b, r) : b; } int main() { int n; cin >> n; bool flag = false; int res = -1; for (int i = 0; i < n; i++) { int a; cin >> a; if (a < 0) continue; if (!flag) { flag = true; res = a; } res = gcd(res, a); } cout << (flag ? 1LL * res * res : res) << endl; }