#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c,d,e;
cin>>e;
if(e%2==0&&e>4&&e<=12)
{
a=1;
b=1;
c=0;
d=0;
}
else if(e%2!=0&&e>4&&e<=12)
{
a=0;
b=1;
c=1;
d=0;
}
else if(e%2==0&&e<4||e>12)
{
a=0;
b=1;
c=1;
d=0;
}
else if(e%2!=0&&e<4||e>12)
{
a=0;
b=0;
c=0;
d=1;
}
cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
return 0;
}
//新人看得懂,注释不写了