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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(a)     (a).begin(),(a).end()
#define RALL(a)     (a).rbegin(),(a).rend()
#define PRINT(a)   cout << (a) << endl

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second

#define debug(x) cerr << x << " " << "(L:" << __LINE__ << ")" << '\n';

using ll = long long int;
using P = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;

template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7;

map<int, int > prime_factor(int n) {
  map<int, int > ret;
  for(int i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}


int main(){
  int n;
  cin >> n;
  map<int, int> cnt;
  int ans=0;
  REP(i,n){
    int a;
    cin >> a;
    map<int,int> mp = prime_factor(a);
    for(auto v: mp){
      cnt[v.first]++;
    }
  }
  int mx=0;
  for(auto v: cnt){
    if(mx < v.second){
      ans = v.first;
      mx = v.second;
    }

  }
  cout << ans << endl;
}


#include <bits/stdc++.h>
#define SIZE 1005
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

int main()
{
	int n;
	scanf("%d",&n);
	int t=1;
	while(t<n) t<<=1;
	for(int i=0;i<n;i++)
	{
		int a=i*2;
		int b=i*2+1;
		for(int j=11;j>=0;j--)
		{
			if(a>=n&&(a>>j&1)) a^=1<<j;
			if(b>=n&&(b>>j&1)) b^=1<<j;
		}
		printf("%d %d\n",a+1,b+1);
	}
}
		