#include<bits/stdc++.h>
using namespace std;
short a,b=0,c=0;
int main(){
cin>>a;
if(a%2==0)b=1;
if(a>=4&&a<=12)c=1;
if(b+c==2){
cout<<"1 ";
}else{
cout<<"0 ";
}
if(b+c){
cout<<"1 ";
}else{
cout<<"0 ";
}
if(b+c==1){
cout<<"1 ";
}else{
cout<<"0 ";
}
if(!(b+c)){
cout<<"1";
}else{
cout<<"0";
}
return 0;//
}