#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';
}

// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

vi divisors(int n) {
  vi v;
  for (int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      v.pb(i);
      if (n != 1 && i * i != n) v.pb(n / i);
    }
  }
  sort(all(v));
  return v;
}

void solve() {
  int n;
  cin >> n;
  vi a(n);
  rep(i, n) cin >> a[i];
  vvi x;
  transform(all(a), back_inserter(x), [](int x) {
    return divisors(x);
  });
  vi ds = accumulate(x.begin() + 1, x.end(), x.front(), [](vi a, vi x) {
    vi w;
    set_intersection(all(a), all(x), back_inserter(w));
    return w;
  });
  for (auto x : ds) cout << x << endl;
}