num = int(input().strip())
l = []
if num % 2 == 0 and num > 4 and num <= 12:
l.append(1)
else:
l.append(0)
if num % 2 == 0 or (num > 4 and num <= 12):
l.append(1)
else:
l.append(0)
if num % 2 == 0 and (num <= 4 or num > 12):
l.append(1)
elif num % 2 != 0 and (num <= 4 or num > 12):
l.append(1)
else:
l.append(0)
if num % 2 != 0 and (num <= 4 or num > 12):
l.append(1)
else:
l.append(0)
for i in l:
print(i,end=" ")