a = int(input())
if a < 0 or a > 1000:
print('错误')
exit()
if a % 2 == 0 and 4 < a < 12:
b = 1
else:
b = 0
if a % 2 == 0 or 4 < a < 12:
c = 1
else:
c = 0
if a % 2 == 0 and a <= 4 or a >= 12:
d = 1
elif a% 2 != 0 and a > 4 or a < 12:
d = 1
else:
d = 0
if a % 2 != 0 and 12 <= a or 4 >= a:
e = 1
else:
e = 0
print(f'{b} {c} {d} {e}')
#大佬请留步,谢谢