#include <bits/stdc++.h>
using namespace std;

vector< int64_t > divisor(int64_t n) {
  vector< int64_t > ret;
  for(int64_t i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  return (ret);
}

int main(){
    cin.tie(0); ios::sync_with_stdio(false);

    int64_t n,a,b,c; cin>>n>>a>>b; if(n==3)cin>>c;
    vector<int64_t> v;
    for(auto t:divisor(a))if(!(b%t))v.push_back(t);
    if(n==3)for(auto t:v)if(c%t)v.erase(find(v.begin(),v.end(),t));
    sort(v.begin(),v.end());
    for(auto t:v)cout<<t<<'\n';
}

#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

vector<int> yakusu(int d){
  vector<int> res;
  for(int i=1; i*i <= d; i++){
    if(d % i == 0) {
      res.push_back(i);
      if(i*i != d) res.push_back(d / i);
    }
  }

  sort(res.begin(), res.end());

  return res;
}

int gcd(int a, int b){
  if(b == 0) return a;
  return gcd(b, a % b);
}

int gcd(int* a, int n){
  if(n == 2) return gcd(a[0], a[1]);
  int b[n-1];
  for(int i=0; i<n-1; i++){
    b[i] = gcd(a[i], a[i+1]);
  }
  return gcd(b, n-1);
}


int main(){
  int n; cin >> n;
  int a[n];
  for(int i=0; i<n; i++) cin >> a[i];

  int g = gcd(a, n);

  for(const auto& x : yakusu(g)){
    cout << x << endl;
  }

  return 0;
}

