#include using namespace std; typedef long long ll; ll a[62]; bool flag[62]; void init() { a[0] = 1; for (int i = 1; i < 63; i ++) { a[i] = a[i - 1] * 2; } } int main() { init(); int N; cin >> N; vector A(N); for (int i = 0; i < N; i ++) cin >> A[i]; for (int i = 0; i < 63; i ++) { for (int j = 0; j < N; j ++) { if ((A[j] & a[i]) != (A[j] + a[i])) {flag[i] = false; break;} else flag[i] = true; } if (flag[i]) break; } for (int i = 0; i < 63; i ++) { if (flag[i]) { cout << a[i] << "\n"; break; } } return 0; }