#include<iostream>
using namespace std;
int main()
{
int n;
bool x,y;
cin>>n;
if(n%2==0)
x=1;
else
x=0;
if(n>4 && n<=12)
y=1;
else
y=0;
//以下为判断
//小A
if(x==1 && y==1)
cout<<1<<" ";
else
cout<<0<<" ";
//Uim
if(x==1 || y==1)
cout<<1<<" ";
else
cout<<0<<" ";
//八尾
if(x==1 && y==1)
cout<<0<<" ";
else if(x=1)
cout<<1<<" ";
else if(y=1)
cout<<1<<" ";
//正妹
if(x==0 && y==0)
cout<<1<<" ";
else
cout<<0<<" ";
return 0;
}