#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll cnt,h=0,zhengmei,haole;
int main(){
cin>>cnt;
if(cnt%2==0){
cout<<1<<" ";
h++;
}else{
cout<<0<<" ";
zhengmei++;
}
if(cnt<12&&4<cnt){
haole++;
h++;
}else{
zhengmei++;
}
if(h>=1){
cout<<1<<" ";
}else{
cout<<0<<" ";
}
if(haole>=1){
cout<<1<<" ";
}else{
cout<<0<<" ";
}
if(zhengmei==2){
cout<<1<<" ";
}else{
cout<<0<<" ";
}
return 0;
}