using System; using System.Collections.Generic; using System.Collections; using System.Collections.Specialized; using System.Linq; using System.Text; using System.IO; using System.Reflection; using static System.Math; using System.Numerics; using System.Runtime.Serialization.Formatters; //using nint=System.Int32; static class Program{ const int mod=(int)1e9+7; const double eps=1e-11; static void Main(){ Sc sc=new Sc(); var n=sc.I; var a=sc.La; var ge=new Ge(); for(int i = 0;i li=new List(); public int cnt=0; public void Add(long v){ int c=cnt; for(int j = 0;jli[j]&&c==cnt){c=j;} } if(v!=0){ li.Add(v); for(int j = cnt-1;j>=0;j--) { li[j]=Min(li[j],v^li[j]); if(j>=c){ li[j+1]=li[j]; if(j==c){li[c]=v;} } } cnt++; } } public long this[int i]{get{return li[i];}} public bool Ck(long v){ for(int i = 0;i(int n,Func f){var a=new T[n];for(int i=0;i(int n,Func f){var a=new T[n];for(int i=0;i(int n,Func f){var a=new T[n];for(int i=0;i(int n,Func f){var a=new T[n];for(int i=0;i