a=int(input()) if a%2==0 and 4<a<13: v=1 else: v=0 if a%2==0: w=1 else: w=0 if 4<a<13: w=1 if w==1: x=1 else: x=0 if a%2==0 and a<=4 or a>12: y=1 if a%2!=0 and 4<a<13: y=1 else: y=0 if a%2!=0 and a<=4 or a>12: z=1 else: z=0 print((v),(x),(y),(z))