#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define ll long long
using namespace std;

 int main(){
     int n;
     cin >> n;
     vector<int> a(n);
    int ma = 0;
     rep(i,n){
    
         cin >> a[i];
    ma = max(ma, a[i]);
    }

    vector<int> ans(ma+1);

    rep(i,ma+1){
        rep(j,n){
            if(i == 0)break;

            if(a[j]%i == 0){
                ans[i]++;
            }
        }
    }
    int count =0;
    int out =0;
    rep(i,ma+1){
        if(i < 2)continue;
        if(count < ans[i]){
            out = i;
            count = ans[i];
        }
    }
    cout << out << endl;

    return 0;
 }
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(void){

    vector< int > usd(10001, 0);
    vector< int > a = {6, 10, 15};
    usd[6] = usd[10] = usd[15] = 1;
    for(int i = 6; i <= 10000; i++){
        if(usd[i] == 1) continue;
        if((i%2==0) + (i%3==0) + (i%5==0) >= 2){
            a.push_back(i);
            usd[i] = 1;
        }
    }

    int n;
    cin >> n;
    for(int i = 0; i < n; i++) cout << a[i] << " "; cout << endl;
}
