#include<iostream>
#include<cmath>
using namespace std;
void solve(int n) {
int n1 = n;
for(int a = 0; a <= sqrt(n1); a++) {
int n2 = n1 - a * a;
for(int b = 0; b <= sqrt(n2); b++) {
int n3 = n2 - b * b;
for(int c = 0; c <= sqrt(n3); c++) {
int n4 = n3 - c * c;
int d = sqrt(n4);
if(n4 == d * d) {
cout << a << " " << b << " " << c << " " << d << endl;
return;
}
}
}
}
}
int main() {
int n;
cin >> n;
solve(n);
return 0;
}