import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int a,b,c,d;
int sqrt=(int) Math.sqrt(n);
for(a=0;a<=sqrt;a++)
for (b = a; b<=sqrt; b++)
for (c= 0; c<=sqrt; c++)
for (d= 0; d<=sqrt; d++)
if(n==a*a+b*b+c*c+d*d)
{
if(c>d)
{
int temp=d;
d=c;
c=temp;
}
System.out.print(a+" "+b+" "+c+" "+d);
return;
}
}
}
7
1 1 1 2