#include<stdio.h>
int main(){
int a=0,b=0,c=0,d=0,x;
scanf("%d",&x);
if((x>4 && x<=12) && x%2==0)
a = 1;
if((x>4 && x<=12) || x%2==0)
b = 1;
if((x>4 && x<=12 && x%2==1)||(x<=4 || x>12)&& x%2==0)
c = 1;
if((x<=4 || x>12)||x%2==1)
d = 1;
printf("%d %d %d %d",a,b,c,d);
return 0;
}