#include using namespace std; typedef long long ll; typedef pair ii; typedef vector vi; typedef vector vii; const int inf=0x3f3f3f3f; #define FOR(i,b,e) for(int i=b; i<=e; i++) #define FORD(i,b,e) for(int i=b; i>=e; i--) #define SIZE(x) ((int)x.size()) #define pb push_back #define st first #define nd second #define sp ' ' #define ent '\n' const int N=2e5+6; const int M=29; int n, k; int t[N]; set ok[M+1], nieok[M+1]; bool usuw[N]; void usun(int i){ usuw[i]=1; FOR(j, 0, M){ if(t[i] & (1<>n>>k; FOR(i, 1, n) cin>>t[i]; FOR(i, 1, n){ FOR(j, 0, M){ if(t[i] & (1<=k){ for(auto &x: nieok[j]) xd.pb(x); for(auto &x: xd) usun(x); xd.clear(); } } int ans=-1; FOR(i, 1, n) if(!usuw[i]) ans&=t[i]; cout<