while 1:i=input();j=i==2 or i>3;print("%i %i %i\n"*3)%(i>2,0,j,i>5,i%2,i>5,j,0,i>2)