#include<iostream>
using namespace std;
int main() {
bool a, b;
int c;
cin >> c;
if (c % 2 == 0)
a = true;
else
a = false;
if (c > 4 && c<=12)
b = true;
else
b = false;
if (a && b == true)
cout << 1 << " ";
else
cout << 0 <<" ";
if (a||b==true)
cout << 1 << " ";
else
cout << 0 << " ";
if ((a || b == true) && (a && b == false))
cout << 1 << " ";
else
cout << 0 << " ";
if (a==false&&b==false)
cout << 1 << " ";
else
cout << 0 << " ";
return 0;
}