#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
bool x1=(n%2==0);
bool x2=(n>4 && x1<=12);
if(x1==1 && x2==1){
cout<<"1"<<" ";
}else{
cout<<"0"<<" ";
}
if(x1==1 || x2==2){
cout<<"1"<<" ";
}else{
cout<<"0"<<" ";
}
if((x1==1 && x2==0) || (x1==0 && x2==1)){
cout<<"1"<<" ";
}else{
cout<<"0"<<" ";
}
if(x1==0 && x2==0){
cout<<"1"<<" ";
}else{
cout<<"0"<<" ";
}
return 0;
}