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