s,a[51],y,c;main(i){for(;~scanf("%d",a+i);s=1)i+=s;for(;y=--i;s^=y-i|c%2?0:1<