($n,$x)=glob<>;@a=(0..2e5);map$x^=$_,1..$n;0while@a[$k,$j]=@a[$j=$j%$n+1,$k=rand(1e5+5-$n)+$n+1],$x^=$a[$j]^$a[$k];print"@a[1..$n]"