#include #include #include #include #include using namespace std; using i32 = int32_t; using u32 = uint32_t; using i64 = int64_t; using u64 = uint64_t; #define rep(i,n) for(int i=0; i<(n); i++) namespace RQ{ using S = int; S e(){ return 1000000000; }; S op(S l, S r){ return 1000000000; }; using F = int; S mapping(F f, S x){ if(f == -1) return x; return f; } F composition(F f, F x){ if(f == -1) return x; return f; } F id(){ return -1; } using RQ = atcoder::lazy_segtree; } namespace RMQ{ using S = int; S e(){ return 1000000000; }; S op(S l, S r){ return min(l,r); }; using RQ = atcoder::segtree; } struct Query{ int l,r,q; }; int main(){ int N; cin >> N; u64 ans = ~(u64)0; rep(i,N){ u64 a; cin >> a; ans &= ~a; } ans = ans & -ans; cout << ans << endl; return 0; } struct ios_do_not_sync { ios_do_not_sync() { ios::sync_with_stdio(false); cin.tie(nullptr); } } ios_do_not_sync_instance;