using System;
using System.Linq;

namespace codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string str = Console.ReadLine();
            if (!str.Contains("1"))
            {
                Console.WriteLine(0);
                return;
            }
            var rez = str.Split('0').Where(x => x != " ").Select(x => x.Trim().Split().Count()).ToArray();
            int max = 0;
            if (str[0] == '1' && str[n - 1] == '1')
                max = rez[0] + rez[rez.Length-1];
            Console.WriteLine( Math.Max(max, rez.Max()));
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i, n, t;
    cin>>t;
    while(t--)
    {
        cin>>n;
        if(n>2 && n%2==0)
        cout<<"YES"<<endl;
        else
        cout<<"NO"<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i, n, t;
    cin>>t;
    while(t--)
    {
        cin>>n;
        if(n==1 || n==3)
        cout<<"NO"<<endl;
        else
        cout<<"YES"<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i, n, t;
    cin>>t;
    while(t--)
    {
        cin>>n;
        if(n%4==0)
        cout<<"YES"<<endl;
        else
        cout<<"NO"<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i, n, t;
    cin>>t;
    while(t--)
    {
        cin>>n;
        if((n/2)%2==0)
        cout<<"YES"<<endl;
        else
        cout<<"NO"<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i, n, t;
    cin>>t;
    while(t--)
    {
        cin>>n;
        if(n%2==0)
        cout<<"YES"<<endl;
        else
        cout<<"NO"<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
#define SZ(x) ((int)x.size())
#define UNI(x) sort(ALL(x)),x.resize(unique(ALL(x))-x.begin());
#define GETPOS(c,x) (lower_bound(ALL(c),x)-c.begin())
#define GETpos(c,x) (lower_bound(ALL(c),x)-c.begin())////
#define MST(x,val) memset((x),val,sizeof((x)));
#define ls rt<<1
#define rs rt<<1|1
#define lson rt<<1,l,M
#define rson rt<<1|1,M+1,r
#define PI acos(-1)
#define MM int M=(l+r)>>1;
#define fu(i,r,t) for(int i=r;i<=t;i++)
#define fd(i,r,t) for(int i=r;i>=t;i--)
#define fh(i,be,e) for(int i=head[be];~i;i=e[i].next)
#define fa(i,V) for(auto i:V)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl '\n'
#define lcm(a,b) (a*b)/__gcd(a,b)
#define cp(i,ans) printf("%.if",ans);
#define cpp(i,ans) cout<<setprecision(i)<<fixed<<ans<<endl;
#define ppb pop_back
#define ppf pop_front
#define pb push_back
#define pf push_front
#define pq priority_queue
#define lowbit(x) (x)&(-x)
#define all(V) V.begin(),V.end()
#define ms multiset
#define mod(x) ((x+mo_num)%mo_num)
#define vc vector
#define vct vector<int>
#define out(i) cout<<(i)<<endl;
#define fi first
#define se second
#define fun(i) fu(i,1,n)
#define fut(i) fu(i,1,t)
#define fum(i) fu(i,1,m)
#define ld long double
#define umap unordered_map
#define P pair<int,int>
#define SET set<int>
#define mp map<int,int>
#define mk make_tuple
#define low lower_bound
#define upp upper_bound
#define yn(key) out(key?"YES":"NO")
#define in(i) i+1,i+1+n
#define im(i) i+1,i+1+m
#define bffs(i) __builtin_ffs(i)
#define bcount(i) __builtin_popcount(i)
#define bone(i) ((1<<i)-1)
#define db double
#define got(container,num) get<num-1>(container)
using namespace std;
//Remember cancel"#define endl '\n'" in interactive questions or use "<<flush"
// use C:printf("%.16f", x);  ->  printf("%.10f", x); can accelerate the program
typedef unsigned long long ull; template<class T> void _R(T &x) { cin >> x; }void _R(int32_t &x) { scanf("%d", &x); }void _R(long long &x) { scanf("%lld", &x); }void _R(ull &x) { scanf("%llu", &x); }void _R(double &x) { scanf("%lf", &x); }void _R(char &x) { scanf(" %c", &x); }void _R(char *x) { scanf("%s", x); }void R() {}template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }template<class T> void _W(const T &x) { cout << x; }void _W(const int32_t &x) { printf("%d", x); }void _W(const long long &x) { printf("%lld", x); }void _W(const double &x) { printf("%.16f", x); }void _W(const char &x) { putchar(x); }void _W(const char *x) { printf("%s", x); }template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }void W() {}template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
const int INF=LLONG_MAX/2,SINF=0x3f3f3f3f,Lim=1<<20,MINF=LLONG_MAX;
const int dx[]={0,0,-1,1},dy[]={-1,1,0,0};//up down left right
const int maxn=1e6+1e5;
const int mo_num=1e9+7;
//const int mo_num=998244353;
int n,m,t,a[maxn],b[maxn],ans;

void solve()
{
//    IOS
//    cin>>n;
    R(n);
    yn(n%4==0)
    return ;
}
main()
{
    int T=1;
    R(T);
//    cin>>T;
    while(T--)solve();
    return 0;
}


#include<bits/stdc++.h>
#define SZ(x) ((int)x.size())
#define UNI(x) sort(ALL(x)),x.resize(unique(ALL(x))-x.begin());
#define GETPOS(c,x) (lower_bound(ALL(c),x)-c.begin())
#define GETpos(c,x) (lower_bound(ALL(c),x)-c.begin())////
#define MST(x,val) memset((x),val,sizeof((x)));
#define ls rt<<1
#define rs rt<<1|1
#define lson rt<<1,l,M
#define rson rt<<1|1,M+1,r
#define PI acos(-1)
#define MM int M=(l+r)>>1;
#define fu(i,r,t) for(int i=r;i<=t;i++)
#define fd(i,r,t) for(int i=r;i>=t;i--)
#define fh(i,be,e) for(int i=head[be];~i;i=e[i].next)
#define fa(i,V) for(auto i:V)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl '\n'
#define lcm(a,b) (a*b)/__gcd(a,b)
#define cp(i,ans) printf("%.if",ans);
#define cpp(i,ans) cout<<setprecision(i)<<fixed<<ans<<endl;
#define ppb pop_back
#define ppf pop_front
#define pb push_back
#define pf push_front
#define pq priority_queue
#define lowbit(x) (x)&(-x)
#define all(V) V.begin(),V.end()
#define ms multiset
#define mod(x) ((x+mo_num)%mo_num)
#define vc vector
#define vct vector<int>
#define out(i) cout<<(i)<<endl;
#define fi first
#define se second
#define fun(i) fu(i,1,n)
#define fut(i) fu(i,1,t)
#define fum(i) fu(i,1,m)
#define ld long double
#define umap unordered_map
#define P pair<int,int>
#define SET set<int>
#define mp map<int,int>
#define mk make_tuple
#define low lower_bound
#define upp upper_bound
#define yn(key) out(key?"YES":"NO")
#define in(i) i+1,i+1+n
#define im(i) i+1,i+1+m
#define bffs(i) __builtin_ffs(i)
#define bcount(i) __builtin_popcount(i)
#define bone(i) ((1<<i)-1)
#define db double
#define got(container,num) get<num-1>(container)
using namespace std;
//Remember cancel"#define endl '\n'" in interactive questions or use "<<flush"
// use C:printf("%.16f", x);  ->  printf("%.10f", x); can accelerate the program
typedef unsigned long long ull; template<class T> void _R(T &x) { cin >> x; }void _R(int32_t &x) { scanf("%d", &x); }void _R(long long &x) { scanf("%lld", &x); }void _R(ull &x) { scanf("%llu", &x); }void _R(double &x) { scanf("%lf", &x); }void _R(char &x) { scanf(" %c", &x); }void _R(char *x) { scanf("%s", x); }void R() {}template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }template<class T> void _W(const T &x) { cout << x; }void _W(const int32_t &x) { printf("%d", x); }void _W(const long long &x) { printf("%lld", x); }void _W(const double &x) { printf("%.16f", x); }void _W(const char &x) { putchar(x); }void _W(const char *x) { printf("%s", x); }template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }void W() {}template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
const int INF=LLONG_MAX/2,SINF=0x3f3f3f3f,Lim=1<<20,MINF=LLONG_MAX;
const int dx[]={0,0,-1,1},dy[]={-1,1,0,0};//up down left right
const int maxn=1e6+1e5;
const int mo_num=1e9+7;
//const int mo_num=998244353;
int n,m,t,a[maxn],b[maxn],ans;

void solve()
{
//    IOS
    cin>>n;
    yn(n%4==0)
    return ;
}
main()
{
    int T=1;
    cin>>T;
    while(T--)solve();
    return 0;
}


#include<bits/stdc++.h>
#define SZ(x) ((int)x.size())
#define UNI(x) sort(ALL(x)),x.resize(unique(ALL(x))-x.begin());
#define GETPOS(c,x) (lower_bound(ALL(c),x)-c.begin())
#define GETpos(c,x) (lower_bound(ALL(c),x)-c.begin())////
#define MST(x,val) memset((x),val,sizeof((x)));
#define ls rt<<1
#define rs rt<<1|1
#define lson rt<<1,l,M
#define rson rt<<1|1,M+1,r
#define PI acos(-1)
#define MM int M=(l+r)>>1;
#define fu(i,r,t) for(int i=r;i<=t;i++)
#define fd(i,r,t) for(int i=r;i>=t;i--)
#define fh(i,be,e) for(int i=head[be];~i;i=e[i].next)
#define fa(i,V) for(auto i:V)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl '\n'
#define lcm(a,b) (a*b)/__gcd(a,b)
#define cp(i,ans) printf("%.if",ans);
#define cpp(i,ans) cout<<setprecision(i)<<fixed<<ans<<endl;
#define ppb pop_back
#define ppf pop_front
#define pb push_back
#define pf push_front
#define pq priority_queue
#define lowbit(x) (x)&(-x)
#define all(V) V.begin(),V.end()
#define ms multiset
#define mod(x) ((x+mo_num)%mo_num)
#define vc vector
#define vct vector<int>
#define out(i) cout<<(i)<<endl;
#define fi first
#define se second
#define fun(i) fu(i,1,n)
#define fut(i) fu(i,1,t)
#define fum(i) fu(i,1,m)
#define ld long double
#define umap unordered_map
#define P pair<int,int>
#define SET set<int>
#define mp map<int,int>
#define mk make_tuple
#define low lower_bound
#define upp upper_bound
#define yn(key) out(key?"YES":"NO")
#define in(i) i+1,i+1+n
#define im(i) i+1,i+1+m
#define bffs(i) __builtin_ffs(i)
#define bcount(i) __builtin_popcount(i)
#define bone(i) ((1<<i)-1)
#define db double
#define got(container,num) get<num-1>(container)
using namespace std;
//Remember cancel"#define endl '\n'" in interactive questions or use "<<flush"
// use C:printf("%.16f", x);  ->  printf("%.10f", x); can accelerate the program
typedef unsigned long long ull; template<class T> void _R(T &x) { cin >> x; }void _R(int32_t &x) { scanf("%d", &x); }void _R(long long &x) { scanf("%lld", &x); }void _R(ull &x) { scanf("%llu", &x); }void _R(double &x) { scanf("%lf", &x); }void _R(char &x) { scanf(" %c", &x); }void _R(char *x) { scanf("%s", x); }void R() {}template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }template<class T> void _W(const T &x) { cout << x; }void _W(const int32_t &x) { printf("%d", x); }void _W(const long long &x) { printf("%lld", x); }void _W(const double &x) { printf("%.16f", x); }void _W(const char &x) { putchar(x); }void _W(const char *x) { printf("%s", x); }template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }void W() {}template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
const int INF=LLONG_MAX/2,SINF=0x3f3f3f3f,Lim=1<<20,MINF=LLONG_MAX;
const int dx[]={0,0,-1,1},dy[]={-1,1,0,0};//up down left right
const int maxn=1e6+1e5;
const int mo_num=1e9+7;
//const int mo_num=998244353;
int n,m,t,a[maxn],b[maxn],ans;

void solve()
{
    IOS
    cin>>n;
    yn(n%4==0)
    return ;
}
main()
{
    int T=1;
    cin>>T;
    while(T--)solve();
    return 0;
}


#include<bits/stdc++.h>
#define SZ(x) ((int)x.size())
#define UNI(x) sort(ALL(x)),x.resize(unique(ALL(x))-x.begin());
#define GETPOS(c,x) (lower_bound(ALL(c),x)-c.begin())
#define GETpos(c,x) (lower_bound(ALL(c),x)-c.begin())////
#define MST(x,val) memset((x),val,sizeof((x)));
#define ls rt<<1
#define rs rt<<1|1
#define lson rt<<1,l,M
#define rson rt<<1|1,M+1,r
#define PI acos(-1)
#define MM int M=(l+r)>>1;
#define fu(i,r,t) for(int i=r;i<=t;i++)
#define fd(i,r,t) for(int i=r;i>=t;i--)
#define fh(i,be,e) for(int i=head[be];~i;i=e[i].next)
#define fa(i,V) for(auto i:V)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl '\n'
#define lcm(a,b) (a*b)/__gcd(a,b)
#define cp(i,ans) printf("%.if",ans);
#define cpp(i,ans) cout<<setprecision(i)<<fixed<<ans<<endl;
#define ppb pop_back
#define ppf pop_front
#define pb push_back
#define pf push_front
#define pq priority_queue
#define lowbit(x) (x)&(-x)
#define all(V) V.begin(),V.end()
#define ms multiset
#define mod(x) ((x+mo_num)%mo_num)
#define vc vector
#define vct vector<int>
#define out(i) cout<<(i)<<endl;
#define fi first
#define se second
#define fun(i) fu(i,1,n)
#define fut(i) fu(i,1,t)
#define fum(i) fu(i,1,m)
#define ld long double
#define umap unordered_map
#define P pair<int,int>
#define SET set<int>
#define mp map<int,int>
#define mk make_tuple
#define low lower_bound
#define upp upper_bound
#define yn(key) out(key?"YES":"NO")
#define in(i) i+1,i+1+n
#define im(i) i+1,i+1+m
#define bffs(i) __builtin_ffs(i)
#define bcount(i) __builtin_popcount(i)
#define bone(i) ((1<<i)-1)
#define db double
#define got(container,num) get<num-1>(container)
using namespace std;
//Remember cancel"#define endl '\n'" in interactive questions or use "<<flush"
// use C:printf("%.16f", x);  ->  printf("%.10f", x); can accelerate the program
typedef unsigned long long ull; template<class T> void _R(T &x) { cin >> x; }void _R(int32_t &x) { scanf("%d", &x); }void _R(long long &x) { scanf("%lld", &x); }void _R(ull &x) { scanf("%llu", &x); }void _R(double &x) { scanf("%lf", &x); }void _R(char &x) { scanf(" %c", &x); }void _R(char *x) { scanf("%s", x); }void R() {}template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }template<class T> void _W(const T &x) { cout << x; }void _W(const int32_t &x) { printf("%d", x); }void _W(const long long &x) { printf("%lld", x); }void _W(const double &x) { printf("%.16f", x); }void _W(const char &x) { putchar(x); }void _W(const char *x) { printf("%s", x); }template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }void W() {}template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
const int INF=LLONG_MAX/2,SINF=0x3f3f3f3f,Lim=1<<20,MINF=LLONG_MAX;
const int dx[]={0,0,-1,1},dy[]={-1,1,0,0};//up down left right
const int maxn=1e6+1e5;
const int mo_num=1e9+7;
//const int mo_num=998244353;
int n,m,t,a[maxn],b[maxn],ans;
main()
{
    cin>>t;
    fut(o)
    {
        cin>>n;
        yn(n%4==0)
    }
    return 0;
}


#include<bits/stdc++.h>
#define SZ(x) ((int)x.size())
#define UNI(x) sort(ALL(x)),x.resize(unique(ALL(x))-x.begin());
#define GETPOS(c,x) (lower_bound(ALL(c),x)-c.begin())
#define GETpos(c,x) (lower_bound(ALL(c),x)-c.begin())////
#define MST(x,val) memset((x),val,sizeof((x)));
#define ls rt<<1
#define rs rt<<1|1
#define lson rt<<1,l,M
#define rson rt<<1|1,M+1,r
#define PI acos(-1)
#define MM int M=(l+r)>>1;
#define fu(i,r,t) for(int i=r;i<=t;i++)
#define fd(i,r,t) for(int i=r;i>=t;i--)
#define fh(i,be,e) for(int i=head[be];~i;i=e[i].next)
#define fa(i,V) for(auto i:V)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl '\n'
#define lcm(a,b) (a*b)/__gcd(a,b)
#define cp(i,ans) printf("%.if",ans);
#define cpp(i,ans) cout<<setprecision(i)<<fixed<<ans<<endl;
#define ppb pop_back
#define ppf pop_front
#define pb push_back
#define pf push_front
#define pq priority_queue
#define lowbit(x) (x)&(-x)
#define all(V) V.begin(),V.end()
#define ms multiset
#define mod(x) ((x+mo_num)%mo_num)
#define vc vector
#define vct vector<int>
#define out(i) cout<<(i)<<endl;
#define fi first
#define se second
#define fun(i) fu(i,1,n)
#define fut(i) fu(i,1,t)
#define fum(i) fu(i,1,m)
#define ld long double
#define umap unordered_map
#define P pair<int,int>
#define SET set<int>
#define mp map<int,int>
#define mk make_tuple
#define low lower_bound
#define upp upper_bound
#define yn(key) out(key?"YES":"NO")
#define in(i) i+1,i+1+n
#define im(i) i+1,i+1+m
#define bffs(i) __builtin_ffs(i)
#define bcount(i) __builtin_popcount(i)
#define bone(i) ((1<<i)-1)
#define db double
#define got(container,num) get<num-1>(container)
using namespace std;
//Remember cancel"#define endl '\n'" in interactive questions or use "<<flush"
// use C:printf("%.16f", x);  ->  printf("%.10f", x); can accelerate the program
typedef unsigned long long ull; template<class T> void _R(T &x) { cin >> x; }void _R(int32_t &x) { scanf("%d", &x); }void _R(long long &x) { scanf("%lld", &x); }void _R(ull &x) { scanf("%llu", &x); }void _R(double &x) { scanf("%lf", &x); }void _R(char &x) { scanf(" %c", &x); }void _R(char *x) { scanf("%s", x); }void R() {}template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }template<class T> void _W(const T &x) { cout << x; }void _W(const int32_t &x) { printf("%d", x); }void _W(const long long &x) { printf("%lld", x); }void _W(const double &x) { printf("%.16f", x); }void _W(const char &x) { putchar(x); }void _W(const char *x) { printf("%s", x); }template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }void W() {}template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
const int INF=LLONG_MAX/2,SINF=0x3f3f3f3f,Lim=1<<20,MINF=LLONG_MAX;
const int dx[]={0,0,-1,1},dy[]={-1,1,0,0};//up down left right
const int maxn=1e6+1e5;
const int mo_num=1e9+7;
//const int mo_num=998244353;
int n,m,t,a[maxn],b[maxn],ans;

void solve()
{
    cin>>n;
    yn(n%4==0)
    return ;
}
main()
{
//    IOS
    int T=1;
    cin>>T;
    while(T--)solve();
    return 0;
}


#include<bits/stdc++.h>
#define SZ(x) ((int)x.size())
#define UNI(x) sort(ALL(x)),x.resize(unique(ALL(x))-x.begin());
#define GETPOS(c,x) (lower_bound(ALL(c),x)-c.begin())
#define GETpos(c,x) (lower_bound(ALL(c),x)-c.begin())////
#define MST(x,val) memset((x),val,sizeof((x)));
#define ls rt<<1
#define rs rt<<1|1
#define lson rt<<1,l,M
#define rson rt<<1|1,M+1,r
#define PI acos(-1)
#define MM int M=(l+r)>>1;
#define fu(i,r,t) for(int i=r;i<=t;i++)
#define fd(i,r,t) for(int i=r;i>=t;i--)
#define fh(i,be,e) for(int i=head[be];~i;i=e[i].next)
#define fa(i,V) for(auto i:V)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl '\n'
#define lcm(a,b) (a*b)/__gcd(a,b)
#define cp(i,ans) printf("%.if",ans);
#define cpp(i,ans) cout<<setprecision(i)<<fixed<<ans<<endl;
#define ppb pop_back
#define ppf pop_front
#define pb push_back
#define pf push_front
#define pq priority_queue
#define lowbit(x) (x)&(-x)
#define all(V) V.begin(),V.end()
#define ms multiset
#define mod(x) ((x+mo_num)%mo_num)
#define vc vector
#define vct vector<int>
#define out(i) cout<<(i)<<endl;
#define fi first
#define se second
#define fun(i) fu(i,1,n)
#define fut(i) fu(i,1,t)
#define fum(i) fu(i,1,m)
#define ld long double
#define umap unordered_map
#define P pair<int,int>
#define SET set<int>
#define mp map<int,int>
#define mk make_tuple
#define low lower_bound
#define upp upper_bound
#define yn(key) out(key?"YES":"NO")
#define in(i) i+1,i+1+n
#define im(i) i+1,i+1+m
#define bffs(i) __builtin_ffs(i)
#define bcount(i) __builtin_popcount(i)
#define bone(i) ((1<<i)-1)
#define db double
#define got(container,num) get<num-1>(container)
using namespace std;
//Remember cancel"#define endl '\n'" in interactive questions or use "<<flush"
// use C:printf("%.16f", x);  ->  printf("%.10f", x); can accelerate the program
typedef unsigned long long ull; template<class T> void _R(T &x) { cin >> x; }void _R(int32_t &x) { scanf("%d", &x); }void _R(long long &x) { scanf("%lld", &x); }void _R(ull &x) { scanf("%llu", &x); }void _R(double &x) { scanf("%lf", &x); }void _R(char &x) { scanf(" %c", &x); }void _R(char *x) { scanf("%s", x); }void R() {}template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }template<class T> void _W(const T &x) { cout << x; }void _W(const int32_t &x) { printf("%d", x); }void _W(const long long &x) { printf("%lld", x); }void _W(const double &x) { printf("%.16f", x); }void _W(const char &x) { putchar(x); }void _W(const char *x) { printf("%s", x); }template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }void W() {}template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
const int INF=LLONG_MAX/2,SINF=0x3f3f3f3f,Lim=1<<20,MINF=LLONG_MAX;
const int dx[]={0,0,-1,1},dy[]={-1,1,0,0};//up down left right
const int maxn=1e6+1e5;
const int mo_num=1e9+7;
//const int mo_num=998244353;
int n,m,t,a[maxn],b[maxn],ans;

void solve()
{
    cin>>n;
    yn(n%4==0)
    return ;
}
main()
{
    IOS
    int T=1;
    cin>>T;
    while(T--)solve();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef long long ll;
#define pb push_back
#define po pop_back
#define pii pair < lli ,lli >
#define it iterator
#define pll pair < ll, ll>
#define plli pair < lli, lli>
#define mp make_pair
#define vi vector <lli>
#define len length
#define fi first
#define sec second
#define sz size
#define rep(i,a,b) for(lli i=a;i<=b;i++)
#define repi(i,a,b) for(lli i=a;i>=b;i--)
#define Pi 3.1415926535897932384626433832795
#define all(c) c.begin(),c.end()
#define alli(c) c.rbegin(),c.rend()
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	 #ifndef ONLINE_JUDGE
	  freopen("input.txt", "r", stdin);
	  freopen("output.txt", "w", stdout);
	#endif
	lli t,ni;
	cin>>t;
	while(t--)
	{
		cin>>ni;
		if(ni>6||ni==4)
			cout<<"YES"<<"\n";
		else
			cout<<"NO"<<"\n";
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef long long ll;
#define pb push_back
#define po pop_back
#define pii pair < lli ,lli >
#define it iterator
#define pll pair < ll, ll>
#define plli pair < lli, lli>
#define mp make_pair
#define vi vector <lli>
#define len length
#define fi first
#define sec second
#define sz size
#define rep(i,a,b) for(lli i=a;i<=b;i++)
#define repi(i,a,b) for(lli i=a;i>=b;i--)
#define Pi 3.1415926535897932384626433832795
#define all(c) c.begin(),c.end()
#define alli(c) c.rbegin(),c.rend()
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	 #ifndef ONLINE_JUDGE
	  freopen("input.txt", "r", stdin);
	  freopen("output.txt", "w", stdout);
	#endif
	lli t,ni;
	cin>>t;
	while(t--)
	{
		cin>>ni;
		if(ni%2==0)
			cout<<"YES"<<"\n";
		else
			cout<<"NO"<<"\n";
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define pb push_back
#define pop pop_back
#define mp make_pair
#define ve vector
#define vii vector < int >
#define vll vector < ll >
#define pii pair < int , int >
#define pll pair < ll , ll >
#define vpl vector < pll >
#define fi first
#define sz size
#define len length
#define se second
//const ll mod=998244353;
const ll mod = 1000000000+7;
const ll N=1000000+6;
#define M_PI 3.14159265358979323846
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    #ifndef ONLINE_JUDGE
      freopen ("INPUT.txt" , "r" , stdin);
      freopen ("OUTPUT.txt", "w" , stdout);
    #endif
      int i,n;
      cin>>n;
      for(i=0;i<n;i++)
      	cout<<i<<"\n";
      cout<<M_PI<<"\n";
      return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef long long ll;
#define pb push_back
#define po pop_back
#define pii pair < lli ,lli >
#define it iterator
#define pll pair < ll, ll>
#define plli pair < lli, lli>
#define mp make_pair
#define vi vector <lli>
#define len length
#define fi first
#define sec second
#define sz size
#define rep(i,a,b) for(lli i=a;i<=b;i++)
#define repi(i,a,b) for(lli i=a;i>=b;i--)
#define Pi 3.1415926535897932384626433832795
#define all(c) c.begin(),c.end()
#define alli(c) c.rbegin(),c.rend()
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	 #ifndef ONLINE_JUDGE
	  freopen("input.txt", "r", stdin);
	  freopen("output.txt", "w", stdout);
	#endif
	lli t,ni;
	cin>>t;
	while(t--)
	{
		cin>>ni;
		if(ni%4==0)
			cout<<"YES"<<"\n";
		else
			cout<<"NO"<<"\n";
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
   int n;
   cin>>n;

   while(n--)
   {
      int a;
      cin>>a;
      if(a%2==0)
         cout<<"Yes"<<endl;
      else cout<<"No"<<endl;
   }
   //else cout<<"No"<<endl;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
   int n;
   cin>>n;

   while(n--)
   {
      long long a;
      cin>>a;
      if(a%4!=0)
         cout<<"No"<<endl;
      else cout<<"Yes"<<endl;
   }
   //else cout<<"No"<<endl;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
   int n;
   cin>>n;

   while(n--)
   {
      long long a;
      cin>>a;
      if(a>3)
         cout<<"Yes"<<endl;
      else cout<<"No"<<endl;
   }
   //else cout<<"No"<<endl;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
   long long int n;
   cin>>n;

   while(n--)
   {
      long long int a;
      cin>>a;
      if(a%2==0)
         cout<<"Yes"<<endl;
      else cout<<"No"<<endl;
   }
   //else cout<<"No"<<endl;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
   int n;
   cin>>n;

   while(n--)
   {
      long long a;
      cin>>a;
      if(a%2==0)
         cout<<"Yes"<<endl;
      else cout<<"No"<<endl;
   }
   //else cout<<"No"<<endl;
}


#include<bits/stdc++.h>
using namespace std;
const int MAX = 2e5+9 ;
const int mod= 998244353;
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define what_is(x) cerr << #x << " = " << x << endl;
typedef long long ll;
int main()
{
    fastIO
    int t;
    cin>>t;

    while(t--)
    {
        int n;
        cin>>n;

        if (n==3)
            cout<<"NO\n";
        else
            cout<<"YES\n";
    }

}


#include<bits/stdc++.h>
using namespace std;
const int MAX = 2e5+9 ;
const int mod= 998244353;
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define what_is(x) cerr << #x << " = " << x << endl;
typedef long long ll;
int main()
{
    fastIO
    int t;
    cin>>t;

    while(t--)
    {
        int n;
        cin>>n;

        if (n==3|| n==6 || n==5 || n==7 )
            cout<<"NO\n";
        else
            cout<<"YES\n";
    }

}


#include<bits/stdc++.h>
using namespace std;
const int MAX = 2e5+9 ;
const int mod= 998244353;
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define what_is(x) cerr << #x << " = " << x << endl;
typedef long long ll;
int main()
{
    fastIO
    int t;
    cin>>t;

    while(t--)
    {
        int n;
        cin>>n;

        if (n%2!=0)
            cout<<"NO\n";
        else
            cout<<"YES\n";
    }

}


#include<bits/stdc++.h>
using namespace std;
const int MAX = 2e5+9 ;
const int mod= 998244353;
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define what_is(x) cerr << #x << " = " << x << endl;
typedef long long ll;
int main()
{
    fastIO
    int t;
    cin>>t;

    while(t--)
    {
        int n;
        cin>>n;

        if (n%2==0)
            cout<<"YES\n";
        else
            cout<<"NO\n";
    }

}


#include <bits/stdc++.h>
using namespace std;
const int mod=998244353;
typedef long long ll;
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define what_is(x) cerr << #x << " is " << x << endl;
int main()
{
    int t;
    cin>>t;

    while(t--)
    {
        int n;
        cin>>n;

        if (n%3==0 && n%2!=0)
            cout<<"NO\n";
        else
            cout<<"YES\n";
    }

}


#include<bits/stdc++.h>
using namespace std;
const int MAX = 2e5+9 ;
const int mod= 998244353;
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define what_is(x) cerr << #x << " = " << x << endl;
typedef long long ll;
int main()
{
    fastIO
    int t;
    cin>>t;

    while(t--)
    {
        int n;
        cin>>n;

        if (n%2!=0 && sqrt(n)!=sqrt(n)*sqrt(n))
            cout<<"NO\n";
        else
            cout<<"YES\n";
    }

}


#include<bits/stdc++.h>
using namespace std;
const int MAX = 2e5+9 ;
const int mod= 998244353;
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define what_is(x) cerr << #x << " = " << x << endl;
typedef long long ll;
int main()
{
    fastIO
    int t;
    cin>>t;

    while(t--)
    {
        int n;
        cin>>n;

        if (n==3|| n==5 || n==7 )
            cout<<"NO\n";
        else
            cout<<"YES\n";
    }

}


#include<bits/stdc++.h>
using namespace std;
const int MAX = 2e5+9 ;
const int mod= 998244353;
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define what_is(x) cerr << #x << " = " << x << endl;
typedef long long ll;
int main()
{
    fastIO
    int t;
    cin>>t;

    while(t--)
    {
        int n;
        cin>>n;

        if (n%2!=0 || n==6)
            cout<<"NO\n";
        else
            cout<<"YES\n";
    }

}


#include<bits/stdc++.h>
using namespace std;
const int MAX = 2e5+9 ;
const int mod= 998244353;
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define what_is(x) cerr << #x << " = " << x << endl;
typedef long long ll;
int main()
{
    fastIO
    int t;
    cin>>t;

    while(t--)
    {
        int n;
        cin>>n;

        if (n%2!=0 && n<10)
            cout<<"NO\n";
        else
            cout<<"YES\n";
    }

}


#include <bits/stdc++.h>
using namespace std;
const int mod=998244353;
typedef long long ll;
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define what_is(x) cerr << #x << " is " << x << endl;
int main()
{
    int t;
    cin>>t;

    while(t--)
    {
        int n;
        cin>>n;

        if (n%3==0 && (n/3)%2!=0)
            cout<<"NO\n";
        else
            cout<<"YES\n";
    }

}


#include<bits/stdc++.h>
using namespace std;
const int MAX = 2e5+9 ;
const int mod= 998244353;
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define what_is(x) cerr << #x << " = " << x << endl;
typedef long long ll;
int main()
{
    fastIO
    int t;
    cin>>t;

    while(t--)
    {
        int n;
        cin>>n;

        if (n==3|| n==6 || n==5)
            cout<<"NO\n";
        else
            cout<<"YES\n";
    }

}


#include <bits/stdc++.h>
using namespace std;
const int mod=998244353;
typedef long long ll;
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define what_is(x) cerr << #x << " is " << x << endl;
int main()
{
    int t;
    cin>>t;

    while(t--)
    {
        int n;
        cin>>n;

        if (n%4!=0 )
            cout<<"NO\n";
        else
            cout<<"YES\n";
    }

}


#include<bits/stdc++.h>
using namespace std;
const int MAX = 2e5+9 ;
const int mod= 998244353;
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define what_is(x) cerr << #x << " = " << x << endl;
typedef long long ll;
int main()
{
    fastIO
    int t;
    cin>>t;

    while(t--)
    {
        int n;
        cin>>n;

        if (n==3|| n==5 || n==7 || n==9)
            cout<<"NO\n";
        else
            cout<<"YES\n";
    }

}


#include<bits/stdc++.h>
using namespace std;
const int MAX = 2e5+9 ;
const int mod= 998244353;
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define what_is(x) cerr << #x << " = " << x << endl;
typedef long long ll;
int main()
{
    fastIO
    int t;
    cin>>t;

    while(t--)
    {
        int n;
        cin>>n;

        if (n==3|| n==6 || n==5 || n==7 || n==9)
            cout<<"NO\n";
        else
            cout<<"YES\n";
    }

}


#include<iostream>
using namespace std;
int main(){
	int t;
	cin>>t;
	ll a;
	while(t--){
		cin>>a;
		if(a<3){
			cout<<"NO"<<endl;
		}else{
			cout<<"YES"<<endl;
		}
	}
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
	int t;
	cin>>t;
	ll a;
	while(t--){
		cin>>a;
		if(a<=3){
			cout<<"NO"<<endl;
		}
		else
		{
			cout<<"YES"<<endl;
		}
	}
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
	int t;
	cin>>t;
	ll a;
	while(t--){
		cin>>a;
		if(a%4==0){
			cout<<"YES"<<endl;
		}
		else
		{
			cout<<"NO"<<endl;
		}
	}
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
	int t;
	cin>>t;
	ll a;
	while(t--){
		cin>>a;
		if(a%4==0){
			cout<<"NO"<<endl;
		}
		else
		{
			cout<<"YES"<<endl;
		}
	}
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
	int t;
	cin>>t;
	ll a;
	while(t--){
		cin>>a;
		if(a%3==0){
			cout<<"NO"<<endl;
		}
		else
		{
			cout<<"YES"<<endl;
		}
	}
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
	int t;
	cin>>t;
	ll a;
	while(t--){
		cin>>a;
		if(a%2==0){
			cout<<"YES"<<endl;
		}
		else
		{
			cout<<"NO"<<endl;
		}
	}
}


#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;

#ifndef ONLINE_JUDGE
const bool DEBUG = true;
#else
const bool DEBUG = false;
#endif

// Reads a 1D vector
template <class T>
void read1d(vector<T> & arg) {
	const int l = arg.size();
	for (int i = 0; i < l; ++i) cin >> arg[i];
}

void read() {}
// Reads arbitrary values
template <class T1, class... T2>
void read(T1& var1, T2&... var2) { cin >> var1; read(var2...); }

void pln() { cout << (DEBUG ? "]\n" : "\n"); }
template <class T1, class... T2>
void pln(const T1& var1, const T2& ... var2) { cout << var1 << " "; pln(var2...); }

// Prints arbitrary values and goes to next line
template <class T1, class... T2>
constexpr void print(const T1& var1, const T2& ... var2) { cout << (DEBUG ? " [ " : ""); pln(var1, var2...); }

// Prints arbitrary values and goes to next line ONLY IF IN DEBUG MODE
template <class T1, class... T2>
constexpr void debug(const T1& var1, const T2& ... var2) { if (!DEBUG) return;  cout << " debug : [ "; pln(var1, var2...); }

using ll = long long;
using ull = unsigned long long;

#define all(x) begin(x), end(x)

const bool MULTIPLE_TEST_CASES = 1;

void exec()
{
	double n;
	read(n);

	double x = floor(n / 4);
	if ((360 / n) * x == 90) print("yes");

	x = floor(3 * n / 4);
	if ((360 / n) * x == 270) print("yes");
	else print("no");

}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);

	if (!MULTIPLE_TEST_CASES)
		exec();
	else {
		int n;
		cin >> n;

		while (n--)
			exec();
	}

    return 0;
}


#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;

#ifndef ONLINE_JUDGE
const bool DEBUG = true;
#else
const bool DEBUG = false;
#endif

// Reads a 1D vector
template <class T>
void read1d(vector<T> & arg) {
	const int l = arg.size();
	for (int i = 0; i < l; ++i) cin >> arg[i];
}

void read() {}
// Reads arbitrary values
template <class T1, class... T2>
void read(T1& var1, T2&... var2) { cin >> var1; read(var2...); }

void pln() { cout << (DEBUG ? "]\n" : "\n"); }
template <class T1, class... T2>
void pln(const T1& var1, const T2& ... var2) { cout << var1 << " "; pln(var2...); }

// Prints arbitrary values and goes to next line
template <class T1, class... T2>
constexpr void print(const T1& var1, const T2& ... var2) { cout << (DEBUG ? " [ " : ""); pln(var1, var2...); }

// Prints arbitrary values and goes to next line ONLY IF IN DEBUG MODE
template <class T1, class... T2>
constexpr void debug(const T1& var1, const T2& ... var2) { if (!DEBUG) return;  cout << " debug : [ "; pln(var1, var2...); }

using ll = long long;
using ull = unsigned long long;

#define all(x) begin(x), end(x)

const bool MULTIPLE_TEST_CASES = 1;

void exec()
{
	double n;
	read(n);

	if (n % 4 == 0) print("yes");
	else print("no");
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);

	if (!MULTIPLE_TEST_CASES)
		exec();
	else {
		int n;
		cin >> n;

		while (n--)
			exec();
	}

    return 0;
}


#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;

#ifndef ONLINE_JUDGE
const bool DEBUG = true;
#else
const bool DEBUG = false;
#endif

// Reads a 1D vector
template <class T>
void read1d(vector<T> & arg) {
	const int l = arg.size();
	for (int i = 0; i < l; ++i) cin >> arg[i];
}

void read() {}
// Reads arbitrary values
template <class T1, class... T2>
void read(T1& var1, T2&... var2) { cin >> var1; read(var2...); }

void pln() { cout << (DEBUG ? "]\n" : "\n"); }
template <class T1, class... T2>
void pln(const T1& var1, const T2& ... var2) { cout << var1 << " "; pln(var2...); }

// Prints arbitrary values and goes to next line
template <class T1, class... T2>
constexpr void print(const T1& var1, const T2& ... var2) { cout << (DEBUG ? " [ " : ""); pln(var1, var2...); }

// Prints arbitrary values and goes to next line ONLY IF IN DEBUG MODE
template <class T1, class... T2>
constexpr void debug(const T1& var1, const T2& ... var2) { if (!DEBUG) return;  cout << " debug : [ "; pln(var1, var2...); }

using ll = long long;
using ull = unsigned long long;

#define all(x) begin(x), end(x)

const bool MULTIPLE_TEST_CASES = 1;

void exec()
{
	double n;
	read(n);

	double x = floor(n / 4);
	if ((360 / n) * x == 90) print("yes");
	else print("no");

}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);

	if (!MULTIPLE_TEST_CASES)
		exec();
	else {
		int n;
		cin >> n;

		while (n--)
			exec();
	}

    return 0;
}


#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;

#ifndef ONLINE_JUDGE
const bool DEBUG = true;
#else
const bool DEBUG = false;
#endif

// Reads a 1D vector
template <class T>
void read1d(vector<T> & arg) {
	const int l = arg.size();
	for (int i = 0; i < l; ++i) cin >> arg[i];
}

void read() {}
// Reads arbitrary values
template <class T1, class... T2>
void read(T1& var1, T2&... var2) { cin >> var1; read(var2...); }

void pln() { cout << (DEBUG ? "]\n" : "\n"); }
template <class T1, class... T2>
void pln(const T1& var1, const T2& ... var2) { cout << var1 << " "; pln(var2...); }

// Prints arbitrary values and goes to next line
template <class T1, class... T2>
constexpr void print(const T1& var1, const T2& ... var2) { cout << (DEBUG ? " [ " : ""); pln(var1, var2...); }

// Prints arbitrary values and goes to next line ONLY IF IN DEBUG MODE
template <class T1, class... T2>
constexpr void debug(const T1& var1, const T2& ... var2) { if (!DEBUG) return;  cout << " debug : [ "; pln(var1, var2...); }

using ll = long long;
using ull = unsigned long long;

#define all(x) begin(x), end(x)

const bool MULTIPLE_TEST_CASES = 1;

void exec()
{
	double n;
	read(n);

	double x = floor(n / 4);
	if ((360 / n) * x == 90) {
		print("yes"); return;
	}

	x = floor(3 * n / 4);
	if ((360 / n) * x == 270) print("yes");
	else print("no");

}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);

	if (!MULTIPLE_TEST_CASES)
		exec();
	else {
		int n;
		cin >> n;

		while (n--)
			exec();
	}

    return 0;
}


#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;

#ifndef ONLINE_JUDGE
const bool DEBUG = true;
#else
const bool DEBUG = false;
#endif

// Reads a 1D vector
template <class T>
void read1d(vector<T> & arg) {
	const int l = arg.size();
	for (int i = 0; i < l; ++i) cin >> arg[i];
}

void read() {}
// Reads arbitrary values
template <class T1, class... T2>
void read(T1& var1, T2&... var2) { cin >> var1; read(var2...); }

void pln() { cout << (DEBUG ? "]\n" : "\n"); }
template <class T1, class... T2>
void pln(const T1& var1, const T2& ... var2) { cout << var1 << " "; pln(var2...); }

// Prints arbitrary values and goes to next line
template <class T1, class... T2>
constexpr void print(const T1& var1, const T2& ... var2) { cout << (DEBUG ? " [ " : ""); pln(var1, var2...); }

// Prints arbitrary values and goes to next line ONLY IF IN DEBUG MODE
template <class T1, class... T2>
constexpr void debug(const T1& var1, const T2& ... var2) { if (!DEBUG) return;  cout << " debug : [ "; pln(var1, var2...); }

using ll = long long;
using ull = unsigned long long;

#define all(x) begin(x), end(x)

const bool MULTIPLE_TEST_CASES = 1;

void exec()
{
	ll n;
	read(n);

	if (n % 4 == 0) print("yes");
	else print("no");
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);

	if (!MULTIPLE_TEST_CASES)
		exec();
	else {
		int n;
		cin >> n;

		while (n--)
			exec();
	}

    return 0;
}


#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;

#ifndef ONLINE_JUDGE
const bool DEBUG = true;
#else
const bool DEBUG = false;
#endif

// Reads a 1D vector
template <class T>
void read1d(vector<T> & arg) {
	const int l = arg.size();
	for (int i = 0; i < l; ++i) cin >> arg[i];
}

void read() {}
// Reads arbitrary values
template <class T1, class... T2>
void read(T1& var1, T2&... var2) { cin >> var1; read(var2...); }

void pln() { cout << (DEBUG ? "]\n" : "\n"); }
template <class T1, class... T2>
void pln(const T1& var1, const T2& ... var2) { cout << var1 << " "; pln(var2...); }

// Prints arbitrary values and goes to next line
template <class T1, class... T2>
constexpr void print(const T1& var1, const T2& ... var2) { cout << (DEBUG ? " [ " : ""); pln(var1, var2...); }

// Prints arbitrary values and goes to next line ONLY IF IN DEBUG MODE
template <class T1, class... T2>
constexpr void debug(const T1& var1, const T2& ... var2) { if (!DEBUG) return;  cout << " debug : [ "; pln(var1, var2...); }

using ll = long long;
using ull = unsigned long long;

#define all(x) begin(x), end(x)

const bool MULTIPLE_TEST_CASES = 1;

void exec()
{
	int n;
	read(n);

	cout << (n % 2 == 0 ? "YES" : "NO") << endl;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);

	if (!MULTIPLE_TEST_CASES)
		exec();
	else {
		int n;
		cin >> n;

		while (n--)
			exec();
	}

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long int n;
        cin>>n;
        if(n*90%180==0)
        cout<<"YES";
        else
        cout<<"NO";
    }
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long int n;
        cin>>n;
        if(n%2==0)
        cout<<"YES";
        else
        cout<<"NO";
    }
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long int n;
        cin>>n;
        if(n%4==0)
        cout<<"YES";
        else
        cout<<"NO";
    }
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long int n;
        cin>>n;
        int p=180 -((n-2)*180/n);

        if(90%p==0)
        cout<<"YES";
        else
        cout<<"NO";
    }
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long int n;
        cin>>n;

        if(n%4==0)
        cout<<"YES"<<endl;
        else
        cout<<"NO"<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long int n;
        cin>>n;
       if(90%4==0)
        cout<<"YES"<<endl;
        else
        cout<<"NO"<<endl;
    }
}


#include <iostream>
using namespace std;
int main() {
	int n,t;
	cin >> t;
	for(int i=0; i<t; i++) {
		cin >> n;
	if(n%2==0 && n>1)
	cout << "yes" << endl;
	else
	cout <<"no" << endl;
}
}


#include <iostream>
using namespace std;
int main() {
	int n,t;
	cin >> t;
	for(int i=0; i<t; i++) {
		cin >> n;
	if(n%2==0 && n>=2)
	cout << "yes" << endl;
	else
	cout <<"no" << endl;
}
}


#include <iostream>
using namespace std;
int main() {
	typedef long long ll;
	ll n,t,c;
	cin >> t;
	for(int i=0; i<t; i++) {
		cin>>n;
		c=180*(n-2)/n;
		if(c%45==0 && n>2)
		cout << "YES" << endl;
		else
		cout << "NO" << endl;
}
}


#include <iostream>
using namespace std;
int main() {
	int n,t;
	cin >> t;
	for(int i=0; i<t; i++) {
		cin >> n;
		if(n%2!=0)
		cout << "NO" << endl;
		else
		cout << "YES" << endl;
	}
}


#include <iostream>
using namespace std;
int main() {
	int n,t;
	cin >> t;
	for(int i=0; i<t; i++) {
		cin >> n;
		if(n%2==0)
		cout << "YES" << endl;
		else
		cout << "NO" << endl;
	}
}


#include <iostream>
using namespace std;
int main() {
	typedef long long ll;
	ll n,t;
	cin >> t;
	for(ll i=0; i<t; i++) {
		cin >> n;
		if(n==0 || n==1) {
			cout << "NO";
			break;
		}
	if(n%2==0)
	cout << "YES" << endl;
	else
	cout <<"NO" << endl;
}
}


#include <iostream>
using namespace std;
int main() {
	int n,t;
	cin >> t;
	for(int i=0; i<t; i++) {
		cin >> n;
		if(n==0 || n==1) {
			cout << "NO";
			break;
		}
	if(n%2==0)
	cout << "YES" << endl;
	else
	cout <<"NO" << endl;
}
}


#include <iostream>
using namespace std;
int main() {
	typedef long long ll;
	ll n,t;
	cin >> t;
	for(ll i=0; i<t; i++) {
		cin >> n;
		if(n==0 || n==1) {
			cout << "NO";
					}
	if(n%4==0)
	cout << "YES" << endl;
	else
	cout <<"NO" << endl;
}
}


#include <iostream>
using namespace std;
int main() {
	typedef long long ll;
	ll n,t;
	cin >> t;
	for(ll i=0; i<t; i++) {
		cin >> n;
		if(n==0 || n==1) {
			cout << "NO";
					}
	if(n%2==0)
	cout << "YES" << endl;
	else
	cout <<"NO" << endl;
}
}


#include <iostream>
using namespace std;
int main() {
	int n,t;
	cin >> t;
	for(int i=0; i<t; i++) {
		cin >> n;
		if(n>3)
		cout << "YES" << endl;
		else
		cout << "NO" << endl;
	}
}


#include <iostream>
using namespace std;
int main() {
	int n,t;
	cin >> t;
	for(int i=0; i<t; i++) {
		cin >> n;
		if(n==0 || n==1) {
			cout << "no";
			break;
		}
	if(n%2==0)
	cout << "yes" << endl;
	else
	cout <<"no" << endl;
}
}


#include <iostream>
using namespace std;
int main() {
	typedef long long ll;
	ll n,t,c;
	cin >> t;
	for(int i=0; i<t; i++) {
		cin>>n;
		c=180*(n-2)/n;
		if(c%45==0 && n!=0)
		cout << "YES" << endl;
		else
		cout << "NO" << endl;
}
}


#include <iostream>
using namespace std;
int main() {
	typedef long long ll;
	ll n,t,c;
	cin >> t;
	for(int i=0; i<t; i++) {
		cin>>n;
	if(n%2==0 && n!=0)
	cout << "YES";
	else
	cout <<"NO";
}
}


#include <iostream>
using namespace std;
int main() {
	int n,t;
	cin >> t;
	for(int i=0; i<t; i++) {
		cin >> n;
	if(n%2==0 && n>1)
	cout << "yes" << endl;
	else
	cout <<"no" << endl;
}
}// opppp p


#include <iostream>
using namespace std;
int main() {
	int n,t;
	cin >> t;
	for(int i=0; i<t; i++) {
		cin >> n;
	if(n%2==0 && n>2)
	cout << "yes" << endl;
	else
	cout <<"no" << endl;
}
}


#include <iostream>
using namespace std;
int main() {
	typedef long long ll;
	ll n,t,c;
	cin >> t;
	for(int i=0; i<t; i++) {
		cin>>n;
		if(n%4==0 && n!=0)
	cout << "YES";
	else
	cout << "NO";
	}
}


#include <iostream>
using namespace std;
int main() {
	typedef long long ll;
	ll n,t,c;
	cin >> t;
	for(int i=0; i<t; i++) {
		cin>>n;
	if(n%2==0 && n>=2)
	cout << "YES";
	else
	cout <<"NO";
}
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const int maxn = 2e6 + 5;
const ll mod = 1e9 + 7;
const ll inf=0x3f3f3f3f;
const ld pi=acos(-1.0);
int n;

void run(){
    cin>>n;
    int tmp=n%4;
    if(tmp==0){
        cout<<"NO\n";
    }else{
        cout<<"YES\n";
    }
}

int main(){
#ifdef haosao
freopen("main.h", "r", stdin);
#endif
    std::ios::sync_with_stdio(false);
    run();
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const int maxn = 2e6 + 5;
const ll mod = 1e9 + 7;
const ll inf=0x3f3f3f3f;
const ld pi=acos(-1.0);
int n;

void run(){
    int t;
    cin>>t;
    for(int i=0;i<t;i++){
        cin>>n;
    int tmp=n%4;
    if(tmp==0){
        cout<<"NO\n";
    }else{
        cout<<"YES\n";
    }
    }

}

int main(){
#ifdef haosao
freopen("main.h", "r", stdin);
#endif
    std::ios::sync_with_stdio(false);
    run();
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const int maxn = 1e7 + 5;

ll n,m;
void run()
{
    cin>>n;
    cout<<(n%4==0)?"yes":"NO" << '\n';
}

int main()
{
    std::ios::sync_with_stdio(0);cin.tie(NULL);
        run();
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const int maxn = 1e7 + 5;

ll n,m;
void run()
{
    cin>>n;
    cout<<((n%4==0)?"yes":"NO") << '\n';
}

int main()
{
    std::ios::sync_with_stdio(0);cin.tie(NULL);
        run();
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const int maxn = 2e6 + 5;
const ll mod = 1e9 + 7;
const ll inf=0x3f3f3f3f;
const ld pi=acos(-1.0);
int n;

void run(){
    int t;
    cin>>t;
    for(int i=0;i<t;i++){
        cin>>n;
    int tmp=n%4;
    if(tmp){
        cout<<"NO\n";
    }else{
        cout<<"YES\n";
    }
    }

}

int main(){
#ifdef haosao
freopen("main.h", "r", stdin);
#endif
    std::ios::sync_with_stdio(false);
    run();
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const int maxn = 2e6 + 5;
const ll mod = 1e9 + 7;
const ll inf=0x3f3f3f3f;
const ld pi=acos(-1.0);

void run(){
    cin>>n;
    int tmp=n%4;
    if(tmp==0){
        cout<<"NO\n";
    }else{
        cout<<"YES\n";
    }
}

int main(){
#ifdef haosao
freopen("main.h", "r", stdin);
#endif
    std::ios::sync_with_stdio(false);
    run();
    return 0;
}


#include <iostream>

using namespace std;

void solve() {
    int n; cin >> n;
    cout << "n=" << n << endl;
    int remainder = (90 * n) / ((n - 2) * 180);
    cout << "remainder=" << remainder << endl;
    if (remainder) {
        cout << "NO" << endl;
    } else {
        cout << "YES" << endl;
    }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int tc; cin >> tc;
    for (int t = 1; t <= tc; ++t) {
        solve();
    }
}


#include <iostream>

using namespace std;

void solve() {
    int n; cin >> n;
    if (90 * n / ((n - 2) * 180)) {
        cout << "YES";
    } else {
        cout << "NO";
    }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int tc; cin >> tc;
    for (int t = 1; t <= tc; ++t) {
        solve();
    }
}


#include <iostream>

using namespace std;

void solve() {
    int n; cin >> n;
    if (90 * n / ((n - 2) * 180)) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int tc; cin >> tc;
    for (int t = 1; t <= tc; ++t) {
        solve();
    }
}


#include <iostream>

using namespace std;

void solve() {
    int n; cin >> n;
    if (n % 4) {
        cout << "NO" << endl;
    } else {
        cout << "YES" << endl;
    }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int tc; cin >> tc;
    for (int t = 1; t <= tc; ++t) {
        solve();
    }
}


#include <iostream>

using namespace std;

void solve() {
    int n; cin >> n;
    int remainder = (90 * n) / ((n - 2) * 180);
    if (remainder) {
        cout << "NO" << endl;
    } else {
        cout << "YES" << endl;
    }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int tc; cin >> tc;
    for (int t = 1; t <= tc; ++t) {
        solve();
    }
}


#include <iostream>

using namespace std;

void solve() {
    int n; cin >> n;
    if (90 * n / ((n - 2) * 180)) {
        cout << "NO" << endl;
    } else {
        cout << "YES" << endl;
    }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int tc; cin >> tc;
    for (int t = 1; t <= tc; ++t) {
        solve();
    }
}


#include <iostream>

using namespace std;

void solve() {
    int n; cin >> n;
    int remainder = (90 * n) % ((n - 2) * 180);
    if (remainder) {
        cout << "NO" << endl;
    } else {
        cout << "YES" << endl;
    }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int tc; cin >> tc;
    for (int t = 1; t <= tc; ++t) {
        solve();
    }
}


using namespace std;

void solve() {
    int n; cin >> n;
    if (90 * n / ((n - 2) * 180)) {
        cout << "YES";
    } else {
        cout << "NO";
    }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    int tc; cin >> tc;
    for (int t = 1; t <= tc; ++t) {
        solve();
    }
}


#define fariha                    \
    ios_base::sync_with_stdio(0); \
    cin.tie(NULL)

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;

int main()
{
    fariha;
    ll t;
    cin >> t;

    while (t--)
    {
        ll n;
        cin >> n;

        if ((n % 2 == 0 && n >= 8) || n == 4)
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }
}


#define fariha                    \
    ios_base::sync_with_stdio(0); \
    cin.tie(NULL)

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;

int main()
{
    fariha;
    ll t;
    cin >> t;

    while (t--)
    {
        ll n;
        cin >> n;

        if(n % 4 == 0) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
}


#define fariha                    \
    ios_base::sync_with_stdio(0); \
    cin.tie(NULL)

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;

int main()
{
    fariha;
    ll t;
    cin >> t;

    while (t--)
    {
        ll n;
        cin >> n;

        if (n % 2 != 0 && n < 8)
            cout << "NO" << endl;
        else
            cout << "YES" << endl;
    }
}


#define fariha                    \
    ios_base::sync_with_stdio(0); \
    cin.tie(NULL)

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;

int main()
{
    fariha;
    ll t;
    cin >> t;

    while (t--)
    {
        ll n;
        cin >> n;

        if (n == 4)
            cout << "YES" << endl;
        else if ((n % 2 == 0) && (n >= 8))
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }
}


#define fariha                    \
    ios_base::sync_with_stdio(0); \
    cin.tie(NULL)

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;

int main()
{
    fariha;
    ll t;
    cin >> t;

    while (t--)
    {
        ll n;
        cin >> n;

        if (n == 3)
            cout << "NO" << endl;
        else
            cout << "YES" << endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        if(n%4==0){cout<<"YES"<<endl;}
    else {cout<<"NO"<<endl;}
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        if(n%2==1){cout<<"NO"<<endl;}
    else {cout<<"YES"<<endl;}
    }
}


#include<bits/stdc++.h>
using namespace std;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        if(n%4==0){cout<<"YES"<<endl;}
    else {cout<<"NO"<<endl;}
    }
        cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}


#include <iostream>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <iomanip>
#include <string>
#include <map>
#include <sstream>
#include <set>
#include <queue>
#define ll long long
using namespace std;

int main(){
    int n,t;
    cin>>n>>t;
    char s[n];
    for(int i=0;i<n;i++){
      if(i<t)s[i]='0';
      else s[i]='1';
    }
    s[n]='\0';
    string st=s;
    int i=0;
    int x;
    cout<<"?"<<" "<<1<<" "<<1<<endl;
     cout.flush();
     cin>>x;
    cout<<"?"<<" "<<1<<" "<<1<<endl;
     cout.flush();
     cin>>x;
     cout<<"?"<<" "<<n-1<<" "<<n<<endl;
     cout.flush();
     cin>>x;
    // while(s!=st || i!=0){
    //   i++;
    //   cout<<"?"<<" "<<1<<" "<<1<<endl;
    //   cout.flush();
    // }
    cout<<"!"<<" "<<st;
    cout.flush();

  return 0;
}


#include <iostream>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <iomanip>
#include <string>
#include <map>
#include <sstream>
#include <set>
#include <queue>
#include <bits/stdc++.h>
#define ll long long
using namespace std;

int queries_left = 9999;

int ask(int x, int y) {
  queries_left--;
  cout << "? " << x + 1 << " " << y + 1 << endl;
  int z;
  cin >> z;
  return z;
}

int main(){

int n, t;
cin >> n >> t;
vector<int> res;
int last = t;
int in_first = 0;
int bits_left = n - 1;
for (int bit = 0; bit < n - 1; bit++) {
  int can_do = queries_left / bits_left / 2;
  int found = 0;
  for (int it = 0; it < can_do; it++) {
    ask(bit + 1, n - 1);
    int u = ask(bit + 1, n - 1);
    if (u != last) {
      int must_be = last - (in_first) + ((bit + 1) - (in_first)); // - 2 * me
      int diff = must_be - u;
      if (diff != 0 && diff != 2) {
        assert(false);
      }
      int me = diff / 2;
      res.push_back(me);
      in_first = (bit + 1) - (in_first + me);
      assert(0 <= in_first && in_first <= bit + 1);
      last = u;
      found = 1;
      break;
    }
    last = u;
  }
  if (!found) {
    int me = (bit + 1) / 2 - in_first;
    assert(me == 0 || me == 1);
    res.push_back(me);
    in_first += me;
  }
  bits_left--;
}
int cur = accumulate(res.begin(), res.end(), 0);
int last_bit = t - cur;
assert(last_bit == 0 || last_bit == 1);
res.push_back(last_bit);
cout << "! ";
for (int x : res) {
  cout << x;
}
cout << endl;
return 0;
}


#include <iostream>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <iomanip>
#include <string>
#include <map>
#include <sstream>
#include <set>
#include <queue>
#define ll long long
using namespace std;

int main(){
    int n,t;
    cin>>n>>t;
    char s[n];
    for(int i=0;i<n;i++){
      if(i<t)s[i]='1';
      else s[i]='0';
    }
    s[n]='\0';
    string st=s;
    int i=0;
    intx;
    cout<<"?"<<" "<<1<<" "<<1<<endl;
     cout.flush();
     cin>>x;
    cout<<"?"<<" "<<1<<" "<<1<<endl;
     cout.flush();
     cin>>x;1
    // while(s!=st || i!=0){
    //   i++;
    //   cout<<"?"<<" "<<1<<" "<<1<<endl;
    //   cout.flush();
    // }
    cout<<"!"<<" "<<st;
    cout.flush();

  return 0;
}


#include <bits/stdc++.h>
using namespace std;

int n, t;
bool s[305];

int qry(int i) {
	printf("? %d %d\n", i+1, n); fflush(stdout);
	int t;
	scanf("%d", &t);
	return t;
}

int main() {
	scanf("%d%d", &n, &t);

	for (int i = 0; ++i < n; ) {
		int dv = 0, nxt;
		for (int j = 0; j < 20; ++j) {
			qry(i);
			nxt = qry(i);
			if (t - nxt) { dv = t - nxt; break; }
		}

		if (dv) do qry(i); while (t != qry(i));

		int cnt = 0;
		for (int j = 0; ++j < i; ) cnt += s[j];
		s[i] = (dv + i) / 2 - cnt;
	}

	int cnt = 0;
	for (int j = 0; ++j < n; ) cnt += s[j];
	s[n] = t - cnt;

	printf("! ");
	for (int i = 0; i++ < n; ) printf("%d", s[i]);
	printf("\n"); fflush(stdout);
}


#include<cstdio>
using namespace std;
int a[310],now[310],n,T,t;
int main()
{
	scanf("%d%d",&n,&t);
	int init=t;
	if(n==1)
	{
		printf("! %d\n",t);
		fflush(stdout);
		return 0;
	}
	for(int i=1;i<n;i++)
	{
		int x;
		bool flag=0;
		for(int j=1;j<=30;j++)
		{
			T++;
			printf("? %d %d\n",i+1,n);
			fflush(stdout);
			for(int j=1;j<i;j++)now[j]^=1;
			scanf("%d",&x);
			if(n-t==x){t=x;continue;}
			t=n-t;
			for(int j=1;j<i;j++)t-=now[j];
			for(int j=1;j<i;j++)t+=(now[j]^=1);
			if(t>x)now[i]=0;else now[i]=1;
			a[i]=now[i]^(T&1)^1;
			flag=1;
			t=x;
			break;
		}
		if(!flag)
		{
			int num=0;
			for(int j=1;j<i;j++)num+=a[j];
			if(num==i/2)a[i]=0;else a[i]=1;
			for(int j=1;j<=i;j++)now[j]=a[j];
			a[i]^=T&1;
		}
	}
	for(int i=1;i<n;i++)init-=a[i];a[n]=init;
	printf("! ");
	for(int i=1;i<=n;i++)printf("%d",a[i]);puts("");
	return 0;
}


#include<cstdio>
#include<cassert>
#include<ctime>
using namespace std;
int a[310],now[310],n,T,t;
int ans[310],p[310];
int get(int l,int r)
{
	printf("? %d %d\n",l,r);
	fflush(stdout);
	int x;scanf("%d",&x);
	return x;
/*	int fuck=rand()&1;
	if(fuck)for(int i=l;i<=n;i++)p[i]^=1;else for(int i=1;i<=r;i++)p[i]^=1;
	int x=0;
	for(int i=1;i<=n;i++)x+=p[i];
	return x;*/
}
int main()
{
//	srand(time(0));
//	for(;;){
	scanf("%d%d",&n,&t);
//	n=4;t=0;
//	for(int i=1;i<=n;i++)ans[i]=rand()&1,p[i]=ans[i],t+=ans[i];
	int init=t;
	if(n==1)
	{
		printf("! %d\n",t);
		fflush(stdout);
		return 0;
	}
	for(int i=1;i<n;i++)
	{
		int x;
		bool flag=0;
		for(int j=1;j<=30;j++)
		{
			T++;
			x=get(i+1,n);
			for(int j=1;j<i;j++)now[j]^=1;
			if(n-t==x){t=x;continue;}
			t=n-t;
			for(int j=1;j<i;j++)t-=now[j];
			for(int j=1;j<i;j++)t+=(now[j]^=1);
			assert(t!=x);
			if(t>x)now[i]=0;else now[i]=1;
			a[i]=now[i]^(T&1)^1;
			flag=1;
			t=x;
			break;
		}
		if(!flag)
		{
			int num=0;
			for(int j=1;j<i;j++)num+=now[j];
			if(num==i/2)now[i]=0;else now[i]=1;
			a[i]=now[i]^(T&1);
		}
	}
	for(int i=1;i<n;i++)init-=a[i];a[n]=init;
	printf("! ");
	for(int i=1;i<=n;i++)printf("%d",a[i]);puts("");
	fflush(stdout);
//	for(int i=1;i<=n;i++)if(a[i]!=ans[i]){puts("fuck");for(int j=1;j<=n;j++)printf("%d",ans[j]);puts("");for(int j=1;j<=n;j++)printf("%d",a[j]);puts("");return 0;}
//		puts("OK");
//	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int ALLOW = 100;

int qr = 0;

int query(int l, int r)
{
    qr++;
    assert(qr <= 10000);
    cout << "? " << l << " " << r << endl;
    int t;
    cin >> t;
    if (t==-1) exit(0);
    return t;
}

string s;
void printSolution()
{
    reverse(s.begin(), s.end());
    cout << "! " << s << endl;
    exit(0);
}

void adjust(int n, int t, int l, int r)
{
    while (1) {
        int _t = query(l, r);
        if (_t==t) return;
        query(l, r);
    }
}

char handle2p(int n, int t, int k, int p)
{
    for (int i = 0; i < ALLOW; i++) {
        int _t = query(1, n-k);
        adjust(n, t, 1, n-k);
        if (_t==n-t+2) return '1';
    }
    return '0';
}

char handle2p2(int n, int t, int k, int p)
{
    for (int i = 0; i < ALLOW; i++) {
        int _t = query(1, n-k);
        adjust(n, t, 1, n-k);
        if (_t==n-t-2) return '0';
    }
    return '1';
}

void solve(int n, int t, int k, int p)
{
    if (k==n) {
        if (p==t) s += '0';
        else s += '1', p++;
        assert(p==t);
        printSolution();
    }

    if (p==t) {
        s += '0';
        solve(n, t, k+1, p);
    }

    if (k==p+p) {
        char c = handle2p(n, t, k, p);
        s += c;
        solve(n, t, k+1, p+c-'0');
    }

    if (k==p+p+2) {
        char c = handle2p2(n, t, k, p);
        s += c;
        solve(n, t, k+1, p+c-'0');
    }

    int _t = query(1, n-k);

    if (_t==n-k-t+p+p) {
        s += '0';
        adjust(n, t, 1, n-k);
        solve(n, t, k+1, p);
    } else if (_t==n-k-t+p+p+2) {
        s += '1';
        adjust(n, t, 1, n-k);
        solve(n, t, k+1, p+1);
    } else {
        solve(n, t, k, p);
    }
}

int main()
{
    int n, t;
    cin >> n >> t;

    solve(n, t, 1, 0);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int ALLOW = 50;

int qr = 0;

int query(int l, int r)
{
    qr++;
    assert(qr <= 10000);
    cout << "? " << l << " " << r << endl;
    int t;
    cin >> t;
    if (t==-1) exit(0);
    return t;
}

string s;
void printSolution()
{
    reverse(s.begin(), s.end());
    cout << "! " << s << endl;
    exit(0);
}

void adjust(int n, int t, int l, int r)
{
    while (1) {
        int _t = query(l, r);
        if (_t==t) return;
        query(l, r);
    }
}

char handle2p(int n, int t, int k, int p)
{
    for (int i = 0; i < ALLOW; i++) {
        int _t = query(1, n-k);
        adjust(n, t, 1, n-k);
        if (_t==n-t+2) return '1';
    }
    return '0';
}

char handle2p2(int n, int t, int k, int p)
{
    for (int i = 0; i < ALLOW; i++) {
        int _t = query(1, n-k);
        adjust(n, t, 1, n-k);
        if (_t==n-t-2) return '0';
    }
    return '1';
}

void solve(int n, int t, int k, int p)
{
    if (k==n) {
        if (p==t) s += '0';
        else s += '1', p++;
        assert(p==t);
        printSolution();
    }

    if (p==t) {
        s += '0';
        solve(n, t, k+1, p);
    }

    if (k==p+p) {
        char c = handle2p(n, t, k, p);
        s += c;
        solve(n, t, k+1, p+c-'0');
    }

    if (k==p+p+2) {
        char c = handle2p2(n, t, k, p);
        s += c;
        solve(n, t, k+1, p+c-'0');
    }

    int _t = query(1, n-k);
    adjust(n, t, 1, n-k);

    if (_t==n-k-t+p+p) {
        s += '0';
        solve(n, t, k+1, p);
    } else if (_t==n-k-t+p+p+2) {
        s += '1';
        solve(n, t, k+1, p+1);
    } else {
        solve(n, t, k, p);
    }
}

int main()
{
    int n, t;
    cin >> n >> t;

    solve(n, t, 1, 0);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int ALLOW = 100;

int qr = 0;

int query(int l, int r)
{
    qr++;
    assert(qr <= 10000);
    cout << "? " << l << " " << r << endl;
    int t;
    cin >> t;
    if (t==-1) exit(0);
    return t;
}

string s;
void printSolution()
{
    reverse(s.begin(), s.end());
    cout << "! " << s << endl;
    exit(0);
}

void adjust(int n, int t, int l, int r)
{
    while (1) {
        int _t = query(l, r);
        if (_t==t) return;
        query(l, r);
    }
}

char handle2p(int n, int t, int k, int p)
{
    for (int i = 0; i < ALLOW; i++) {
        int _t = query(1, n-k);
        adjust(n, t, 1, n-k);
        if (_t==n-t+2) return '1';
    }
    return '0';
}

char handle2p2(int n, int t, int k, int p)
{
    for (int i = 0; i < ALLOW; i++) {
        int _t = query(1, n-k);
        adjust(n, t, 1, n-k);
        if (_t==n-t-2) return '0';
    }
    return '1';
}

void solve(int n, int t, int k, int p)
{
    if (k==n) {
        if (p==t) s += '0';
        else s += '1', p++;
        assert(p==t);
        printSolution();
    }

    if (p==t) {
        s += '0';
        solve(n, t, k+1, p);
    }

    if (k==p+p) {
        char c = handle2p(n, t, k, p);
        s += c;
        solve(n, t, k+1, p+c-'0');
    }

    if (k==p+p+2) {
        char c = handle2p2(n, t, k, p);
        s += c;
        solve(n, t, k+1, p+c-'0');
    }

    int _t = query(1, n-k);
    adjust(n, t, 1, n-k);

    if (_t==n-k-t+p+p) {
        s += '0';
        solve(n, t, k+1, p);
    } else if (_t==n-k-t+p+p+2) {
        s += '1';
        solve(n, t, k+1, p+1);
    } else {
        solve(n, t, k, p);
    }
}

int main()
{
    int n, t;
    cin >> n >> t;

    solve(n, t, 1, 0);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int ALLOW = 20;

int qr = 0;

int query(int l, int r)
{
    qr++;
    assert(qr <= 10000);
    cout << "? " << l << " " << r << endl;
    int t;
    cin >> t;
    if (t==-1) exit(0);
    return t;
}

string s;
void printSolution()
{
    reverse(s.begin(), s.end());
    cout << "! " << s << endl;
    exit(0);
}

void adjust(int n, int t, int l, int r)
{
    while (1) {
        int _t = query(l, r);
        if (_t==t) return;
        query(l, r);
    }
}

char handle2p(int n, int t, int k, int p)
{
    for (int i = 0; i < ALLOW; i++) {
        int _t = query(1, n-k);
        adjust(n, t, 1, n-k);
        if (_t==n-t+2) return '1';
    }
    return '0';
}

char handle2p2(int n, int t, int k, int p)
{
    for (int i = 0; i < ALLOW; i++) {
        int _t = query(1, n-k);
        adjust(n, t, 1, n-k);
        if (_t==n-t-2) return '0';
    }
    return '1';
}

void solve(int n, int t, int k, int p)
{
    if (k==n) {
        if (p==t) s += '0';
        else s += '1', p++;
        assert(p==t);
        printSolution();
    }

    if (p==t) {
        s += '0';
        solve(n, t, k+1, p);
    }

    if (k==p+p) {
        char c = handle2p(n, t, k, p);
        s += c;
        solve(n, t, k+1, p+c-'0');
    }

    if (k==p+p+2) {
        char c = handle2p2(n, t, k, p);
        s += c;
        solve(n, t, k+1, p+c-'0');
    }

    int _t = query(1, n-k);

    if (_t==n-k-t+p+p) {
        s += '0';
        adjust(n, t, 1, n-k);
        solve(n, t, k+1, p);
    } else if (_t==n-k-t+p+p+2) {
        s += '1';
        adjust(n, t, 1, n-k);
        solve(n, t, k+1, p+1);
    } else {
        solve(n, t, k, p);
    }
}

int main()
{
    int n, t;
    cin >> n >> t;

    solve(n, t, 1, 0);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int ALLOW = 75;

int qr = 0;

int query(int l, int r)
{
    qr++;
    assert(qr <= 10000);
    cout << "? " << l << " " << r << endl;
    int t;
    cin >> t;
    if (t==-1) exit(0);
    return t;
}

string s;
void printSolution()
{
    reverse(s.begin(), s.end());
    cout << "! " << s << endl;
    exit(0);
}

void adjust(int n, int t, int l, int r)
{
    while (1) {
        int _t = query(l, r);
        if (_t==t) return;
        query(l, r);
    }
}

char handle2p(int n, int t, int k, int p)
{
    for (int i = 0; i < ALLOW; i++) {
        int _t = query(1, n-k);
        adjust(n, t, 1, n-k);
        if (_t==n-t+2) return '1';
    }
    return '0';
}

char handle2p2(int n, int t, int k, int p)
{
    for (int i = 0; i < ALLOW; i++) {
        int _t = query(1, n-k);
        adjust(n, t, 1, n-k);
        if (_t==n-t-2) return '0';
    }
    return '1';
}

void solve(int n, int t, int k, int p)
{
    if (k==n) {
        if (p==t) s += '0';
        else s += '1', p++;
        assert(p==t);
        printSolution();
    }

    if (p==t) {
        s += '0';
        solve(n, t, k+1, p);
    }

    if (k==p+p) {
        char c = handle2p(n, t, k, p);
        s += c;
        solve(n, t, k+1, p+c-'0');
    }

    if (k==p+p+2) {
        char c = handle2p2(n, t, k, p);
        s += c;
        solve(n, t, k+1, p+c-'0');
    }

    int _t = query(1, n-k);

    if (_t==n-k-t+p+p) {
        s += '0';
        adjust(n, t, 1, n-k);
        solve(n, t, k+1, p);
    } else if (_t==n-k-t+p+p+2) {
        s += '1';
        adjust(n, t, 1, n-k);
        solve(n, t, k+1, p+1);
    } else {
        solve(n, t, k, p);
    }
}

int main()
{
    int n, t;
    cin >> n >> t;

    solve(n, t, 1, 0);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int ALLOW = 100;

int query(int l, int r)
{
    cout << "? " << l << " " << r << endl;
    int t;
    cin >> t;
    if (t==-1) exit(0);
    return t;
}

string s;
void printSolution()
{
    reverse(s.begin(), s.end());
    cout << "! " << s << endl;
    exit(0);
}

void adjust(int n, int t, int l, int r)
{
    while (1) {
        int _t = query(l, r);
        if (_t==t) return;
        query(l, r);
    }
}

char handle2p(int n, int t, int k, int p)
{
    for (int i = 0; i < ALLOW; i++) {
        int _t = query(1, n-k);
        adjust(n, t, 1, n-k);
        if (_t==n-t+2) return '1';
    }
    return '0';
}

char handle2p2(int n, int t, int k, int p)
{
    for (int i = 0; i < ALLOW; i++) {
        int _t = query(1, n-k);
        adjust(n, t, 1, n-k);
        if (_t==n-t-2) return '0';
    }
    return '1';
}

void solve(int n, int t, int k, int p)
{
    if (k==n) {
        if (p==t) s += '0';
        else s += '1', p++;
        assert(p==t);
        printSolution();
    }

    if (p==t) {
        s += '0';
        solve(n, t, k+1, p);
    }

    if (k==p+p) {
        char c = handle2p(n, t, k, p);
        s += c;
        solve(n, t, k+1, p+c-'0');
    }

    if (k==p+p+2) {
        char c = handle2p2(n, t, k, p);
        s += c;
        solve(n, t, k+1, p+c-'0');
    }

    int _t = query(1, n-k);

    if (_t==n-k-t+p+p) {
        s += '0';
        adjust(n, t, 1, n-k);
        solve(n, t, k+1, p);
    } else if (_t==n-k-t+p+p+2) {
        s += '1';
        adjust(n, t, 1, n-k);
        solve(n, t, k+1, p+1);
    } else {
        solve(n, t, k, p);
    }
}

int main()
{
    int n, t;
    cin >> n >> t;

    solve(n, t, 1, 0);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int ALLOW = 50;

int query(int l, int r)
{
    cout << "? " << l << " " << r << endl;
    int t;
    cin >> t;
    if (t==-1) exit(0);
    return t;
}

string s;
void printSolution()
{
    reverse(s.begin(), s.end());
    cout << "! " << s << endl;
    exit(0);
}

void adjust(int n, int t, int l, int r)
{
    while (1) {
        int _t = query(l, r);
        if (_t==t) return;
        query(l, r);
    }
}

char handle2p(int n, int t, int k, int p)
{
    for (int i = 0; i < ALLOW; i++) {
        int _t = query(1, n-k);
        adjust(n, t, 1, n-k);
        if (_t==n-t+2) return '1';
    }
    return '0';
}

char handle2p2(int n, int t, int k, int p)
{
    for (int i = 0; i < ALLOW; i++) {
        int _t = query(1, n-k);
        adjust(n, t, 1, n-k);
        if (_t==n-t-2) return '0';
    }
    return '1';
}

void solve(int n, int t, int k, int p)
{
    if (k==n) {
        if (p==t) s += '0';
        else s += '1', p++;
        assert(p==t);
        printSolution();
    }

    if (p==t) {
        s += '0';
        solve(n, t, k+1, p);
    }

    if (k==p+p) {
        char c = handle2p(n, t, k, p);
        s += c;
        solve(n, t, k+1, p+c-'0');
    }

    if (k==p+p+2) {
        char c = handle2p2(n, t, k, p);
        s += c;
        solve(n, t, k+1, p+c-'0');
    }

    int _t = query(1, n-k);

    if (_t==n-k-t+p+p) {
        s += '0';
        adjust(n, t, 1, n-k);
        solve(n, t, k+1, p);
    } else if (_t==n-k-t+p+p+2) {
        s += '1';
        adjust(n, t, 1, n-k);
        solve(n, t, k+1, p+1);
    } else {
        solve(n, t, k, p);
    }
}

int main()
{
    int n, t;
    cin >> n >> t;

    solve(n, t, 1, 0);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int ALLOW = 200;

int qr = 0;

int query(int l, int r)
{
    qr++;
    assert(qr <= 10000);
    cout << "? " << l << " " << r << endl;
    int t;
    cin >> t;
    if (t==-1) exit(0);
    return t;
}

string s;
void printSolution()
{
    reverse(s.begin(), s.end());
    cout << "! " << s << endl;
    exit(0);
}

void adjust(int n, int t, int l, int r)
{
    while (1) {
        int _t = query(l, r);
        if (_t==t) return;
        query(l, r);
    }
}

char handle2p(int n, int t, int k, int p)
{
    for (int i = 0; i < ALLOW; i++) {
        int _t = query(1, n-k);
        adjust(n, t, 1, n-k);
        if (_t==n-t+2) return '1';
    }
    return '0';
}

char handle2p2(int n, int t, int k, int p)
{
    for (int i = 0; i < ALLOW; i++) {
        int _t = query(1, n-k);
        adjust(n, t, 1, n-k);
        if (_t==n-t-2) return '0';
    }
    return '1';
}

void solve(int n, int t, int k, int p)
{
    if (k==n) {
        if (p==t) s += '0';
        else s += '1', p++;
        assert(p==t);
        printSolution();
    }

    if (p==t) {
        s += '0';
        solve(n, t, k+1, p);
    }

    if (k==p+p) {
        char c = handle2p(n, t, k, p);
        s += c;
        solve(n, t, k+1, p+c-'0');
    }

    if (k==p+p+2) {
        char c = handle2p2(n, t, k, p);
        s += c;
        solve(n, t, k+1, p+c-'0');
    }

    int _t = query(1, n-k);

    if (_t==n-k-t+p+p) {
        s += '0';
        adjust(n, t, 1, n-k);
        solve(n, t, k+1, p);
    } else if (_t==n-k-t+p+p+2) {
        s += '1';
        adjust(n, t, 1, n-k);
        solve(n, t, k+1, p+1);
    } else {
        solve(n, t, k, p);
    }
}

int main()
{
    int n, t;
    cin >> n >> t;

    solve(n, t, 1, 0);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int ALLOW = 85;

int qr = 0;

int query(int l, int r)
{
    qr++;
    assert(qr <= 10000);
    cout << "? " << l << " " << r << endl;
    int t;
    cin >> t;
    if (t==-1) exit(0);
    return t;
}

string s;
void printSolution()
{
    reverse(s.begin(), s.end());
    cout << "! " << s << endl;
    exit(0);
}

void adjust(int n, int t, int l, int r)
{
    while (1) {
        int _t = query(l, r);
        if (_t==t) return;
        query(l, r);
    }
}

char handle2p(int n, int t, int k, int p)
{
    for (int i = 0; i < ALLOW; i++) {
        int _t = query(1, n-k);
        adjust(n, t, 1, n-k);
        if (_t==n-t+2) return '1';
    }
    return '0';
}

char handle2p2(int n, int t, int k, int p)
{
    for (int i = 0; i < ALLOW; i++) {
        int _t = query(1, n-k);
        adjust(n, t, 1, n-k);
        if (_t==n-t-2) return '0';
    }
    return '1';
}

void solve(int n, int t, int k, int p)
{
    if (k==n) {
        if (p==t) s += '0';
        else s += '1', p++;
        assert(p==t);
        printSolution();
    }

    if (p==t) {
        s += '0';
        solve(n, t, k+1, p);
    }

    if (k==p+p) {
        char c = handle2p(n, t, k, p);
        s += c;
        solve(n, t, k+1, p+c-'0');
    }

    if (k==p+p+2) {
        char c = handle2p2(n, t, k, p);
        s += c;
        solve(n, t, k+1, p+c-'0');
    }

    int _t = query(1, n-k);

    if (_t==n-k-t+p+p) {
        s += '0';
        adjust(n, t, 1, n-k);
        solve(n, t, k+1, p);
    } else if (_t==n-k-t+p+p+2) {
        s += '1';
        adjust(n, t, 1, n-k);
        solve(n, t, k+1, p+1);
    } else {
        solve(n, t, k, p);
    }
}

int main()
{
    int n, t;
    cin >> n >> t;

    solve(n, t, 1, 0);

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, t, cover[310], a[310];

int aa[310];
int cnt;
void init() {
	scanf("%d%d", &n, &t);

	// srand(time(0));
	// cnt = 0;
	// n = 9;
	// for (int i = 1; i <= n; i++)
	// 	aa[i] = rand() % 2;
	// for (int i = 1; i <= n; i++)
	// 	t += aa[i];
	// for (int i = 1; i <= n; i++)
	// 	printf("%d", aa[i]);
	// printf("\n");
}

int query(int l, int r) {
	printf("? %d %d\n", l, r);
	fflush(stdout);
	int x;
	scanf("%d", &x);
	return x;
	// cnt++;
	// if (rand() % 2 == 0) {
	// 	for (int i = 1; i <= r; i++)
	// 		aa[i] ^= 1;
	// }else {
	// 	for (int i = l; i <= n; i++)
	// 		aa[i] ^= 1;
	// }
	// int s = 0;
	// for (int i = 1; i <= n; i++)
	// 	s += aa[i];
	// return s;
}

int main() {
	init();
	// scanf("%d%d", &n, &t);
	int q = 1, h = n;
	while (q <= h) {
		if (q == h) {
			int ss = 0;
			for (int i = 1; i <= n; i++)
				if (i != q)
					ss += a[i] ^ cover[i];
			if (ss == t)
				a[q] = cover[q];
			else
				a[q] = cover[q] ^ 1;
			break;
		}else {
			while (true) {
				int nt = query(q, h - 1);
				if ((h - 1) % 2 == (nt - t + 10000) % 2) {
					// 1, h - 1
					int ss = 0;
					for (int i = h + 1; i <= n; i++)
						ss += a[i] ^ cover[i];
					if (h - (t - ss) < nt - ss)
						a[h] = 1 ^ cover[h];
					else
						a[h] = cover[h];

					for (int i = 1; i <= h - 1; i++)
						cover[i] ^= 1;
					t = nt;
					break;
				}else {
					// q, n
					for (int i = q; i <= n; i++)
						cover[i] ^= 1;
					t = nt;
				}
			}

			while (true) {
				int nt = query(q + 1, h);
				if ((n - q) % 2 == (nt - t + 10000) % 2) {
					// q + 1, n
					int ss = 0;
					for (int i = 1; i < q; i++)
						ss += a[i] ^ cover[i];
					if (h - (t - ss) < nt - ss)
						a[q] = 1 ^ cover[q];
					else
						a[q] = cover[q];

					for (int i = q + 1; i <= n; i++)
						cover[i] ^= 1;
					t = nt;
					break;
				}else {
					// 1, h
					for (int i = 1; i <= h; i++)
						cover[i] ^= 1;
					t = nt;
				}
			}

			q++;
			h--;
		}
	}
	printf("! ");
	for (int i = 1; i <= n; i++) {
		printf("%d", a[i]);
	}
	printf("\n");
	fflush(stdout);
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define sd(x) scanf("%d", &(x))
#define pii pair<int, int>
#define F first
#define S second

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

const int ITER = 30;
int n;
set<int> odd, even;

int get(int x, int y){
	printf("? %d %d\n", x, y);
	fflush(stdout);
	int t;
	scanf("%d", &t);
	return t;
}

const int N = 1000;
int suff[N];

int go(int l, int t){
	int enter_t = t;
	odd.clear();
	int now_t = t;
	for(int i = 1; i <= ITER; i++){
		now_t = get(l, n);
		if(i & 1){
			odd.insert(now_t - enter_t);
			// trace(now_t - enter_t);
		}
	}

	auto it = odd.begin();
	if(*it ==  n - 2 * t && it != odd.end()) it++;

	int L = n - l + 1;
	// L - 2 * (ones) = *it
	suff[l] = (L - *it) / 2;
	return now_t;
}
int ans[N];
int main(){
	int t;
	sd(n); sd(t);
	for(int i = 1; i <= n; i++){
		t = go(i, t);
	}
	printf("! ");
	for(int i = 1; i <= n; i++) printf("%d", suff[i] - suff[i + 1]);
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define sd(x) scanf("%d", &(x))
#define pii pair<int, int>
#define F first
#define S second

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

const int ITER = 30;
int n;
set<int> odd, even;

int get(int x, int y){
	printf("? %d %d\n", x, y);
	fflush(stdout);
	int t;
	scanf("%d", &t);
}

const int N = 1000;
int suff[N];

int go(int l, int t){
	int enter_t = t;
	even.clear(); odd.clear();
	even.insert(0);
	int now_t = t;
	for(int i = 1; i <= ITER; i++){
		now_t = get(l, n);
		if(i & 1) odd.insert(now_t - enter_t);
		else even.insert(now_t - enter_t);
	}
	auto it = odd.begin();
	if(*it ==  n - 2 * t && it != odd.end()) it++;

	int L = n - l + 1;
	// L - 2 * (ones) = *it
	suff[l] = (L - *it) / 2;
	return now_t;
}
int ans[N];
int main(){
	int t;
	sd(n); sd(t);
	for(int i = 1; i <= n; i++){
		t = go(i, t);
	}
	printf("! ");
	for(int i = 1; i <= n; i++) printf("%d", suff[i] - suff[i + 1]);
}


#include <bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d", &(x))

const int ITER = 30;
int n;
set<int> odd, even;

int get(int x, int y){
	printf("? %d %d\n", x, y);
	fflush(stdout);
	int t;
	scanf("%d", &t);
	return t;
}

const int N = 1000;
int suff[N];

int go(int l, int t){
	int enter_t = t;
	odd.clear();
	int now_t = t;
	for(int i = 1; i <= ITER; i++){
		now_t = get(l, n);
		if(i & 1){
			odd.insert(now_t - enter_t);
		}
	}
	auto it = odd.begin();
	if(*it ==  n - 2 * t && odd.size() == 2) it++;
	int L = n - l + 1;
	suff[l] = (L - *it) / 2;
	return now_t;
}
int ans[N];
int main(){
	int t;
	sd(n); sd(t);
	for(int i = 1; i <= n; i++){
		t = go(i, t);
	}
	printf("! ");
	for(int i = 1; i <= n; i++) printf("%d", suff[i] - suff[i + 1]);
}


#pragma comment(linker, "/STACK:512000000")
#define _CRT_SECURE_NO_WARNINGS
//#include "testlib.h"
#include <bits/stdc++.h>
#ifdef AIM
#include <sys/resource.h>
#endif
using namespace std;

#define all(a) a.begin(), a.end()
using li = long long;
using ld = long double;
void solve(bool);
void precalc();
clock_t start;
int main() {
#ifdef AIM
  //freopen("/home/alexandero/CLionProjects/ACM/input.txt", "r", stdin);
  //freopen("/home/alexandero/CLionProjects/ACM/output.txt", "w", stdout);
//freopen("out.txt", "w", stdout);
#else
  //freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
#endif

#ifdef AIM
  const rlim_t kStackSize = 256 * 1024 * 1024;
  struct rlimit rl;
  int result;

  result = getrlimit(RLIMIT_STACK, &rl);
  if (result == 0) {
    if (rl.rlim_cur < kStackSize) {
      rl.rlim_cur = kStackSize;
      result = setrlimit(RLIMIT_STACK, &rl);
      if (result != 0) {
        fprintf(stderr, "setrlimit returned result = %d\n", result);
      }
    }
  }
#endif

  start = clock();
  int t = 1;
#ifndef AIM
  cout.sync_with_stdio(0);
  cin.tie(0);
#endif
  cout.precision(20);
  cout << fixed;
  //cin >> t;
  precalc();
  while (t--) {
    solve(true);
  }
  cout.flush();

#ifdef AIM1
  while (true) {
    solve(false);
  }
#endif

#ifdef AIM
  cerr << "\n\n time: " << (clock() - start) / 1.0 / CLOCKS_PER_SEC << "\n\n";
#endif
  return 0;
}

//BE CAREFUL: IS INT REALLY INT?

template<typename T>
T binpow(T q, T w, T mod) {
  if (!w)
    return 1 % mod;
  if (w & 1)
    return q * 1LL * binpow(q, w - 1, mod) % mod;
  return binpow(q * 1LL * q % mod, w / 2, mod);
}

template<typename T>
T gcd(T q, T w) {
  while (w) {
    q %= w;
    swap(q, w);
  }
  return q;
}
template<typename T>
T lcm(T q, T w) {
  return q / gcd(q, w) * w;
}

template <typename T>
void make_unique(vector<T>& vec) {
  sort(all(vec));
  vec.erase(unique(all(vec)), vec.end());
}

template<typename T>
void relax_min(T& cur, T val) {
  cur = min(cur, val);
}

template<typename T>
void relax_max(T& cur, T val) {
  cur = max(cur, val);
}

mt19937 rng((unsigned long long)chrono::steady_clock::now().time_since_epoch().count());

void precalc() {

}

//#define int li
//const li mod = 1000000007;
//const int mod = 998244353;
//using ull = unsigned long long;

bool local = false;

int n;
vector<int> vec;
vector<int> start_vec;

int queries = 0;

int get_cnt(int l, int r) {
  ++queries;
  if (local) {
    if (rand() & 1) {
      for (int i = l; i < n; ++i) {
        vec[i] = 1 - vec[i];
      }
    } else {
      for (int i = 0; i <= r; ++i) {
        vec[i] = 1 - vec[i];
      }
    }
    int res = 0;
    for (int x : vec) {
      res += x;
    }
    return res;
  } else {
    cout << "? " << l + 1 << " " << r + 1 << endl;
    int res;
    cin >> res;
    if (res == -1) {
      exit(0);
    }
    return res;
  }
}

void output_ans(vector<int> res) {
  if (local) {
    assert(res == start_vec);
  }
  cout << "! ";
  for (int x : res) {
    cout << x;
  }
  cout << endl;
}

void solve(__attribute__((unused)) bool read) {
  queries = 0;
  int t = 0;
  if (local) {
    n = rand() % 10 + 1;
    vec.assign(n, 0);
    for (int i = 0; i < n; ++i) {
      vec[i] = rand() & 1;
      t += vec[i];
    }
    start_vec = vec;
  } else {
    cin >> n;
    cin >> t;
  }
  if (n == 1) {
    output_ans({t});
    return;
  }
  int new_t = get_cnt(0, n - 2);
  vector<int> prefs(n, 0), sufs(n, 0);
  while (new_t == n - t) {
    ++prefs[n - 1];
    t = new_t;
    new_t = get_cnt(0, n - 2);
  }
  ++prefs[n - 2];
  vector<int> got(n, -1);
  if (new_t == n - t + 1) {
    got[n - 1] = 1;
  } else if (new_t == n - 1 - t) {
    got[n - 1] = 0;
  } else {
    assert(false);
  }
  t = new_t;
  for (int suf = n - 2; suf >= 0; --suf) {
    bool found;
    do {
      found = false;
      int y = 0;
      int b = 0;
      for (int i = suf + 1; i < n; ++i) {
        b += got[i];
      }
      int a = t - b;
      for (int pref = suf; pref < n; ++pref) {
        if ((n - suf + pref) % 2) {
          continue;
        }
        if (pref > suf) {
          y += got[pref];
        }
        int easy = b - y + (pref + 1 - a - y);
        int hard = n - suf + a - b;
        new_t = get_cnt(suf, pref);
        if (new_t == easy) {
          for (int i = suf + 1; i <= pref; ++i) {
            got[i] = 1 - got[i];
          }
          ++prefs[pref];
          found = false;
        } else {
          int val = hard - new_t;
          assert(val == 0 || val == 2);
          got[suf] = val / 2;
          ++sufs[suf];
          for (int i = suf; i < n; ++i) {
            got[i] = 1 - got[i];
          }
          found = true;
        }
        t = new_t;
        break;
      }
    } while (!found);
  }

  for (int i = 0; i < n; ++i) {
    got[i] ^= (sufs[i] & 1);
    if (i + 1 < n) {
      sufs[i + 1] += sufs[i];
    }
  }
  for (int i = n - 1; i >= 0; --i) {
    got[i] ^= (prefs[i] & 1);
    if (i) {
      prefs[i - 1] += prefs[i];
    }
  }
  output_ans(got);

  cerr << "used " << queries << endl;

}


#include<bits/stdc++.h>
#define pi pair<int,int>
#define mk make_pair
#define N 500005
using namespace std;
int n,m,now,cntt,val[N];
struct node{int x,y;}tmp[N];
vector<node>G;
int main(){
	scanf("%d%d",&n,&m);now=m;
	if (n==1){
		printf("! %d\n",m);
		fflush(stdout);
		return 0;
	}
	for (int i=1;i<=n;i++)
		for (int j=i;j<=n;j++)
			if (j-i+1+n&1) G.push_back((node){i,j});
	for (int i=1;i<=n;i++) val[i]=-1;
	for (int i=1;i<n;i++){
		while (val[i]==-1){
			int cas=rand()%5+1;
			while (cas--){
				int pos=(rand()+rand())%G.size();//
				int x=G[pos].x;
				int y=G[pos].y;
				int last=now;
				printf("? %d %d\n",x,y);
				fflush(stdout);
				scanf("%d",&now);
				if ((now^last^y)%2){
					tmp[++cntt]=(node){x,n};
					for (int j=x;j<=n;j++) if (val[j]!=-1) val[j]^=1;
				}
				else {
					tmp[++cntt]=(node){1,y};
					for (int j=1;j<=y;j++) if (val[j]!=-1) val[j]^=1;
				}
			}
			int x=rand()%n+1;
			if (x>i){
				int l=i+1;int r=x;
				if ((n^r^l)%2) continue;
				int last=now;
				printf("? %d %d\n",l,r);
				fflush(stdout);
				scanf("%d",&now);
				if ((now^last^r)%2){
					tmp[++cntt]=(node){l,n};
					for (int j=l;j<=n;j++) if (val[j]!=-1) val[j]^=1;
					val[i]=(now-last+n-i)>>1;val[i]=now-val[i];
					for (int j=1;j<i;j++) val[i]=val[i]-val[j];
					break;
				}
				else {
					tmp[++cntt]=(node){1,r};
					for (int j=1;j<=r;j++) if (val[j]!=-1) val[j]^=1;
				}
			}
			else {
				int l=x;int r=i;
				if ((n^r^l)%2) continue;
				int last=now;
				printf("? %d %d\n",l,r);
				fflush(stdout);
				scanf("%d",&now);
				if ((now^last^r)%2){
					for (int j=l;j<=n;j++) if (val[j]!=-1) val[j]^=1;
					tmp[++cntt]=(node){l,n};
				}
				else {
					for (int j=1;j<=r;j++) if (val[j]!=-1) val[j]^=1;
					tmp[++cntt]=(node){1,r};
					val[i]=(now-last+r)>>1;
					for (int j=1;j<i;j++) val[i]=val[i]-val[j];
					break;
				}
			}
		}
	}
	for (int i=1;i<n;i++) now-=val[i];val[n]=now;
	for (int i=cntt;i;i--)
		for (int j=tmp[i].x;j<=tmp[i].y;j++) if (val[j]!=-1) val[j]^=1;
	printf("! ");
	for (int i=1;i<=n;i++) printf("%d",val[i]);puts("");
	fflush(stdout);
	return 0;
}


#include<bits/stdc++.h>
#define pi pair<int,int>
#define mk make_pair
#define N 500005
using namespace std;
int n,m,now,cntt,val[N];
struct node{int x,y;}tmp[N];
vector<node>G;
int main(){
	scanf("%d%d",&n,&m);now=m;
	if (n==1){
		printf("! %d\n",m);
		fflush(stdout);
		return 0;
	}
	for (int i=1;i<=n;i++)
		for (int j=i;j<=n;j++)
			if (j-i+1+n&1) G.push_back((node){i,j});
	for (int i=1;i<=n;i++) val[i]=-1;
	for (int i=1;i<n;i++){
		while (val[i]==-1){
			int cas=rand()%5+1;
			while (cas--){
				int pos=rand()%G.size();//
				int x=G[pos].x;
				int y=G[pos].y;
				int last=now;
				printf("? %d %d\n",x,y);
				fflush(stdout);
				scanf("%d",&now);
				if ((now^last^y)%2){
					tmp[++cntt]=(node){x,n};
					for (int j=x;j<=n;j++) if (val[j]!=-1) val[j]^=1;
				}
				else {
					tmp[++cntt]=(node){1,y};
					for (int j=1;j<=y;j++) if (val[j]==-1) val[j]^=1;
				}
			}
			int x=rand()%n+1;
			if (x>i){
				int l=i+1;int r=x;
				if ((n^r^l)%2) continue;
				int last=now;
				printf("? %d %d\n",l,r);
				fflush(stdout);
				scanf("%d",&now);
				if ((now^last^r)%2){
					tmp[++cntt]=(node){l,n};
					for (int j=l;j<=n;j++) if (val[j]!=-1) val[j]^=1;
					val[i]=(now-last+n-i)>>1;val[i]=now-val[i];
					for (int j=1;j<i;j++) val[i]=val[i]-val[j];
					break;
				}
				else {
					tmp[++cntt]=(node){1,r};
					for (int j=1;j<=r;j++) if (val[j]!=-1) val[j]^=1;
				}
			}
			else {
				int l=x;int r=i;
				if ((n^r^l)%2) continue;
				int last=now;
				printf("? %d %d\n",l,r);
				fflush(stdout);
				scanf("%d",&now);
				if ((now^last^r)%2){
					for (int j=l;j<=n;j++) if (val[j]!=-1) val[j]^=1;
					tmp[++cntt]=(node){l,n};
				}
				else {
					for (int j=1;j<=r;j++) if (val[j]!=-1) val[j]^=1;
					tmp[++cntt]=(node){1,r};
					val[i]=(now-last+r)>>1;
					for (int j=1;j<i;j++) val[i]=val[i]-val[j];
					break;
				}
			}
		}
	}
	for (int i=1;i<n;i++) now-=val[i];val[n]=now;
	for (int i=cntt;i;i--)
		for (int j=tmp[i].x;j<=tmp[i].y;j++) if (val[j]!=-1) val[j]^=1;
	printf("! ");
	for (int i=1;i<=n;i++) printf("%d",val[i]);
	fflush(stdout);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i, x, n) for (int i = x; i < (int)(n); ++i)

int const N = 300;
char s[N + 1];
int ot, nt, n;

int qu0(int l, int r){
	int an;
	printf("? %d %d\n", l, r);
	fflush(stdout);
	scanf("%d", &an);
	return an;
}

void qu(int l, int r){
	int an;
	do {
		qu0(l, r);
		an = qu0(l, r);
	}while (an == nt);
	ot = nt;
	nt = an;
}

void fn(){
	printf("! %s\n", s);
	exit(0);
}

char flp(char c) { return c == '1' ? '0' : '1'; }

void fix(){
	f(i, 1, n)if (!s[i] && s[i - 1])s[i] = flp(s[i - 1]);
	for (int i = n - 1; i > 0; --i)if (!s[i - 1] && s[i])s[i - 1] = flp(s[i]);
}

int main(){
	scanf("%d%d", &n, &nt);
	if (n == 1){
		s[0] = nt + '0';
		fn();
	}
	if (n & 1){
		f(i, 1, n){
			qu(i, i + 1);
			if (ot + nt == n - 2)s[i - 1] = s[i] = '0';
			else if (ot + nt == n + 2)s[i - 1] = s[i] = '1';
			qu(i, i + 1);
		}
		fix();
		if (!s[0]){
			qu(1, 2);
			if (nt > ot)s[0] = '0';
			else s[0] = '1';
			fix();
		}
		fn();
	}else {
		f(i, 1, n + 1){
			qu(i, i);
			if (ot + nt == n - 1)s[i - 1] = '0';
			else s[i - 1] = '1';
			qu(i, i);
		}
		fn();
	}
}


#ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>

#define FASTIO
#define ALL(v) (v).begin(), (v).end()
#define rep(i, l, r) for (int i = (l); i < (r); ++i)

#ifdef FASTIO
#define scanf abacaba
#define printf abacaba
#endif

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

using namespace std;

/*
ll pw(ll a, ll b) {
	ll ans = 1; while (b) {
		while (!(b & 1)) b >>= 1, a = (a * a) % MOD;
		ans = (ans * a) % MOD, --b;
	} return ans;
}
*/

int n, t;

int ask(int l, int r) {
	cout << "? " << l + 1 << " " << r << "\n";
	cout.flush();
	int x;
	cin >> x;
	return x;
}

pair<int, int> get(int l, int r) {
	assert(l % 2 != (n - r) % 2);
	int a = 0;
	int b = 0;
	int cur = t;
	int gl = r;
	int gr = n - l;
	while (a != 1 || b != 0) {
		int nw = ask(l, r);
		if ((cur + nw) % 2 == gl % 2)
			a ^= 1;
		else
			b ^= 1;
		cur = nw;
	}
	int al = (gl - cur + t) / 2;
	while (a != 0 || b != 1) {
		int nw = ask(l, r);
		if ((cur + nw) % 2 == gl % 2)
			a ^= 1;
		else
			b ^= 1;
		cur = nw;
	}
	int ar = (gr - cur + t) / 2;
	while (a != 0 || b != 0) {
		int nw = ask(l, r);
		if ((cur + nw) % 2 == gl % 2)
			a ^= 1;
		else
			b ^= 1;
		cur = nw;
	}
	return {al, ar};
}

const int MAXN = 310;
int a[MAXN];
pair<int, int> d[MAXN];

int main() {
#ifdef FASTIO
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#endif
	cin >> n >> t;
	if (n == 1) {
		cout << "! " << t << "\n";
		cout.flush();
		return 0;
	}
	if (n % 2 == 0) {
		for (int i = 0; i < n; ++i)
			a[i] = get(i, i + 1).first;
		for (int i = n - 1; i > 0; --i)
			a[i] = a[i] - a[i - 1];
		cout << "! ";
		for (int i = 0; i < n; ++i)
			cout << a[i];
		cout << "\n";
		cout.flush();
		return 0;
	}
	for (int i = 0; i + 1 < n; ++i) {
		d[i] = get(i, i + 2);
	}
	for (int i = 2; i < n; ++i)
		a[i] = d[i - 1].first - d[i - 2].first;
	int sum = 0;
	for (int i = 2; i < n; ++i)
		sum += a[i];
	a[1] = d[1].second - sum;
	sum += a[1];
	a[0] = d[0].second - sum;
	cout << "! ";
	for (int i = 0; i < n; ++i)
		cout << a[i];
	cout << "\n";
	cout.flush();
	return 0;
}


#include<bits/stdc++.h>

int ask(int l, int r){
    printf("? %d %d\n", l, r);
    fflush(stdout);
    int t;
    scanf("%d", &t);
    if (t == -1){
        exit(0);
    }
    return t;
}

const int N = 310;

int a[N], rev[N];

bool check(int l, int r, int diff){
    return ((r - l + 1 + diff) & 1) == 0;
}

void rever(int l, int r){
    for (int i = l; i <= r; ++ i){
        rev[i] ^= 1;
    }
}

int main(){
    int n, t;
    scanf("%d%d", &n, &t);
    if (n == 1){
        printf("! %d\n", t);
        return 0;
    }
    for (int i = 1; i <= n; ++ i){
        if (i == 1){
            while (true){
                int nt = ask(2, n);
                if (check(2, n, nt - t)){
                    rever(2, n);
                    a[1] = rev[1] ^ (n - t + 1 == nt);
                    t = nt;
                    break;
                }
                else{
                    rever(1, n);
                    t = nt;
                }
            }
            continue;
        }
        int r = i, l = ((n - 1) & 1) == ((r - 1) & 1) ? 2 : 1;
        while (true){
            int nt = ask(l, r);
            if (check(1, r, nt - t)){
                int cnt = 0;
                for (int j = 1; j <= i; ++ j){
                    cnt += a[j] ^ rev[j];
                }
                if (i - cnt + t - cnt != nt){
                    a[i] = 1;
                }
                rever(1, r);
                t = nt;
                break;
            }
            else{
                rever(l, n);
                t = nt;
            }
        }
    }
    printf("! ");
    for (int i = 1; i <= n; ++ i){
        putchar('0' + a[i]);
    }
    putchar('\n');
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAXN = 305;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
template <typename T> void chkmax(T &x, T y) {x = max(x, y); }
template <typename T> void chkmin(T &x, T y) {x = min(x, y); }
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
template <typename T> void write(T x) {
	if (x < 0) x = -x, putchar('-');
	if (x > 9) write(x / 10);
	putchar(x % 10 + '0');
}
template <typename T> void writeln(T x) {
	write(x);
	puts("");
}
char ans[MAXN];
int n, t, p;
int main() {
	cin >> n >> t;
	int last = t;
	for (int i = 1; i <= n - 1; i++) {
		int va = -1, vb = last, p = last - t;
		bool solved = false;
		for (int j = 1; j <= 16; j++) {
			cout << '?' << ' ' << i + 1 << ' ' << n << endl;
			int x; cin >> x;
			cout << '?' << ' ' << i + 1 << ' ' << n << endl;
			int y; cin >> y;
			last = y;
			if (va == -1) va = x;
			if (vb == -1) vb = y;
			if (va != x) {
				assert((va + x - i) % 2 == 0);
				int nt = (n - i) - (va + x - i) / 2;
				ans[i] = '0' + (t - nt), t = nt;
				solved = true;
				break;
			}
			if (vb != y) {
				assert((vb + y - i) % 2 == 0);
				int nt = (vb + y - i) / 2;
				ans[i] = '0' + (t - nt), t = nt;
				solved = true;
				break;
			}
		}
		if (!solved) {
			assert(i % 2 == 0);
			ans[i] = i / 2 - p + '0';
			t -= ans[i] - '0';
		}
	}
	ans[n] = '0' + t;
	printf("! %s", ans + 1);
	cout << endl;
	return 0;
}