//#define _GLIBCXX_DEBUG #include #include #include using namespace std; using ll = long long; using pii = pair; using pll = pair; using vi = vector; using vvi = vector; using vl = vector; using vvl = vector; using vb = vector; using vvb = vector; using vpi = vector; using vvpi = vector; using vpl = vector; using vvpl = vector; const int inf = 1 << 30; const ll INF = 1LL << 60; #define rep(i,m,n) for (int i = m; i < (int)(n); i++) #define rrep(i,m,n) for (int i = m; i > (int)(n); i--) int main(){ int n; cin >> n; vl A(n); rep(i,0,n){ cin >> A[i]; } rep(i,0,62){ bool tf = true; rep(j,0,n){ if (A[j]>>i & 1){ tf = false; break; } } if (tf){ ll ans = 1LL << i; cout << ans << endl; return 0; } } }