import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n= sc.nextInt();
        //循环剪枝
        for(int a=0;a<=Math.sqrt(n);a++){
            for(int b=a;a*a+b*b<=n;b++){
                for(int c=b;a*a+b*b+c*c<=n;c++){
                    int temp=n-a*a-b*b-c*c;
                    int d=(int) Math.sqrt(temp);
                    if(d*d==temp){
                        System.out.println(a+" "+b+" "+c+" "+d);
                        return;
                    }
                }
            }
        }
    }
}