#include using namespace std; #define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define rep(i,n) repl(i,0,n) #define mp(a,b) make_pair((a),(b)) #define pb(a) push_back((a)) #define all(x) (x).begin(),(x).end() #define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x)) #define fi first #define se second #define dbg(x) cout<<#x" = "<<((x))< ostream& operator<<(ostream& o, const pair &p){o<<"("< ostream& operator<<(ostream& o, const vector &v){o<<"[";for(T t:v){o< &vec){//dbg(mp(d,vec)); if(vec.size()==0) return INF; else if(d==0) return vec[0]; d--; int n = vec.size(); vector nxt[2]; rep(i,n) nxt[(vec[i]>>d)%2].pb(vec[i]%(1<>n; vector vec(n); rep(i,n) cin>>vec[i]; int mx = *max_element(all(vec)); int dig = 0; while(mx>0){dig++; mx/=2;} cout << solve(dig, vec) << endl; return 0; }