#include #include using namespace std; const int M=2000000; int main(){ bitsetA,B; int N,S,T,U,V,Q; scanf("%d%d%d%d%d%d",&N,&S,&T,&U,&V,&Q); A[0]=S%2; for(int i=1;i>=S+M-T-1; A^=B<