#include using namespace std; #include using namespace atcoder; #define ll long long #define rep(i, n) for (int i = 0; i < (n); i++) #define P pair #define LP pair #define fi first #define se second #define pb push_back #define eb emplace_back #define all(s) s.begin(), s.end() #define rall(s) s.rbegin(), s.rend() template void chmax(T& a, T b) { a = max(a, b); }; template void chmin(T& a, T b) { a = min(a, b); }; int main() { int n; cin >> n; ll tot = 0; rep(i,n) { ll a; cin >> a; tot |= a; } int j = 0; while (true) { if (tot>>j&1) { j++; continue; } ll ans = (1ll<