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