#include #include using namespace std; namespace my{ #define LL(...) ll __VA_ARGS__;lin(__VA_ARGS__) #define FO(n) for(ll ij=n;ij--;) #define FOR(i,...) for(auto[i,i##stop,i##step]=range(0,__VA_ARGS__);i=i##stop;i-=i##step) #define multiple_testcases void solve();}int main(){my::io();int T;std::cin>>T;while(T--)my::solve();}namespace my{ void io(){cin.tie(nullptr)->sync_with_stdio(0);cout<r{0,0,1};ll I=0;((r[I++]=a),...);if(!s&&I==1)swap(r[0],r[1]);r[0]-=s;return r;} constexpr char newline=10; constexpr char space=32; void lin(auto&...a){(cin>>...>>a);} templatevoid pp(const auto&...a){ll n=sizeof...(a);((cout<0,c)),...);cout<ll{ if(n==0)return 0; return(sqrt_floor(n)+sqrt_floor(n/2))&1; }; pp((f(R)-f(L-1))&1); }}