h,k,l=6,5,60 while 1:n=eval(input().replace('2','2*'))+32;print(n%5-2,2-n%6,n//l)