// Arup Guha
// 1/2/2025
// Solution to 2024 SER D1/D2 Problem: Perfect Squares

import java.util.*;
import java.math.BigInteger;

public class perfectsquares {
	
	public static HashMap<Long,Long> sq;

	public static void main(String[] args) {

		// Useful to look up what are perfect squares.
		sq = new HashMap<Long,Long>();
		for (long i=1; i<=1000000; i++)
			sq.put(i*i, i);
		
		// Get input.
		Scanner stdin = new Scanner(System.in);
		long n = stdin.nextLong();
		
		// They tell us this.
		if (ofform(n))
			System.out.println(-1);
		
		// Didn't want to run into issues with small numbers.
		else if (n < 10000) 
			solveSmall(n);

		// Solve for bigger numbers.
		else {
			
			// Our idea won't work for n = 0 mod 4, but we can just multiply 2 into each
			// number for each multiple of 4...
			int pow4 = 0;
			while (n%4 == 0) {
				pow4++;
				n /= 4;
			}
			
			// Now we can solve it!
			solveBig(n, pow4);	
		}
	}
	
	// Assumes n is 1 mod 4.
	public static boolean isprime(long n) {
		
		// I think this will save time.
		if (n > 100000000) {
			BigInteger t = new BigInteger(""+n);
			return t.isProbablePrime(20);
		}
		
		// I thought max 5,000 iterations would be small enough...
		for (long i=3; i*i<=n; i+=2)
			if (n%i == 0)
				return false;
		return true;
	}
	
	// Just a brute force...
	public static void solveSmall(long n) {
		for (int i=0; i<100; i++) {
			for (int j=i; j<100; j++) {
				for (int k=j; k<100; k++) {
					if (i*i + j*j + k*k == n) {
						System.out.println(i+" "+j+" "+k);
						return;
					}
				}
			}
		}				
	}
	
	// Solving for n*(4^pow4).
	public static void solveBig(long n, int pow4) {
		
		// What I will multiply back into the answer...
		long mult = (1<<pow4);
		
		// I go backwards...
		long max = (long)Math.sqrt(n);
		if (max*max > n) max--;
			
		// i will be my first value in my solution.
		for (long i=max; i>=0; i--) {
			
			// Here's what's left.
			long left = n - i*i;
			
			// So we're told this will work, screen it out.
			if (left%4 == 1 && isprime(left)) {
			
				// Since we're confident there's an answer, just brute force our second
				// value.
				for (long j=0; j*j<=left; j++) {
					
					// We need this to be a perfect square. When it is, output our answer.
					long tmp = left - j*j;
					if (sq.containsKey(tmp)) {
						long last = sq.get(tmp);
						System.out.println((i*mult)+" "+(j*mult)+" "+(last*mult));
						return;
					}
				}
			}
			
			// So if n is 3 mod 4, then we're guaranteed that subtracting an odd square will
			// make it 2 mod 4. So, what we do here is use the fact that if it's 2 mod 8,
			// dividing that number by 2 yields a number that is 1 mod 4. If that new number
			// is prime, then we know it has a solution with 2 terms. BUT, recall that 
			// 2 = 1*1 + 1*1. So, let's say left/2 = a*a + b*b. Then it's definitely the
			// case that (a+b)*(a+b) + (a-b)*(a-b) = left. 
			
			// More generally, if a = x*x + y*y and b = w*w + z*z, 
			//                 then ab = (xw+yz)*(xw+yz) + (xz-yw)*(xz-yw)
			// So in this case, we find a solution for left/2 with 2 terms and then
			// construct the solution for left with 2 terms.
			else if (left%8 == 2 && isprime(left/2)) {
				
				// This is the value I want to solve for with 2 squares.
				long tmpleft = left/2;
				
				// Brute force.
				for (long j=0; j*j<=tmpleft; j++) {
					
					// See if what's left is a square.
					long tmp = tmpleft - j*j;
					if (sq.containsKey(tmp)) {
						
						// Got it.
						long last = sq.get(tmp);
						
						// left/2 = j*j + last*left, it follows that
						// left = (j+left)*(j+left) + (j-left)*(j-left).
						
						// Update the solution for left as described above.
						long x = j+last;
						long y = j-last; if (y<0) y=-y;
						
						// Ta da!
						System.out.println((i*mult)+" "+(x*mult)+" "+(y*mult));
						return;
					}
				}				
			}
		}		
	}
	
	// Returns true iff n is of the form that doesn't work.
	public static boolean ofform(long n) {
		while (n%4 == 0) n /= 4;
		return n%8 == 7;
	}
}