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