#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define all(a) (a).begin(), (a).end()
const int maxn = 1e6 + 1;
ll res = 0, status = 1;
void ham(ll x, ll n) {
if (n == 0) {
cout << status;
return;
}
status += status * x;
ham(x, n - 1);
}
vector<int> a;
map<int, int> freq;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, x;
cin >> n;
int ma = 0;
for (int i = 0; i < n; i++) {
cin >> x;
a.push_back(x);
freq[a[i]]++;
ma = max(ma, x);
}
for (int g = ma; g >= 1; g--) {
int count = 0;
for (int i = g; i <= ma; i += g) {
count += freq[i];
if (count >= 2) { // Nếu tìm thấy ít nhất 2 số chia hết cho g
cout << g << endl;
return 0;
}
}
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgdWxsIHVuc2lnbmVkIGxvbmcgbG9uZwojZGVmaW5lIGFsbChhKSAoYSkuYmVnaW4oKSwgKGEpLmVuZCgpCmNvbnN0IGludCBtYXhuID0gMWU2ICsgMTsKbGwgcmVzID0gMCwgc3RhdHVzID0gMTsKdm9pZCBoYW0obGwgeCwgbGwgbikgewoJaWYgKG4gPT0gMCkgewoJCWNvdXQgPDwgc3RhdHVzOwoJCXJldHVybjsKCX0KCXN0YXR1cyArPSBzdGF0dXMgKiB4OwoJaGFtKHgsIG4gLSAxKTsKfQp2ZWN0b3I8aW50PiBhOwptYXA8aW50LCBpbnQ+IGZyZXE7CmludCBtYWluKCkgewoJaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7CgljaW4udGllKDApOwoJY291dC50aWUoMCk7CglpbnQgbiwgeDsKCWNpbiA+PiBuOwoJaW50IG1hID0gMDsKCWZvciAoaW50IGkgPSAwOyBpIDwgbjsgaSsrKSB7CgkJY2luID4+IHg7CgkJYS5wdXNoX2JhY2soeCk7C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