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