a=int(input())
b=a%2
c=(4<a<=12)
if b==False and c:
print("1",end=" ")
else:
print("0",end=" ")
if b==False or c:
print("1",end=" ")
else:
print("0",end=" ")
if (b==False and not c) or (c and not b==False):
print("1",end=" ")
else:
print("0",end=" ")
if not(b==False and c):
print("1",end=" ")
else:
print("0",end=" ")