// 入力とかに使うもの
var reader = require('readline').createInterface({ input: process.stdin, output: process.stdout });
var lines = [];
reader.on('line', function (line) { lines.push(line); });

//
function pf(n) {
	var c = 1;
	var result = [];

	if (n === 1) {
		return [1];
	}

	var init = 2;

	while (n !== 1) {
		var i = init;
		while (i < Number.MAX_SAFE_INTEGER) {
			if (n % i == 0) {
				result.push(i);
				c = c * i;
				if(c > 1000000000) return result;
				n /= i;
				break;
			}
			i++;
		}
		init = i;
	}
	return result;
}

// メイン
reader.on('close', function () {
	var s = Number(lines[0]);
	var n = pf(s);
	console.log(n);
	var w = 1;
	for(var i in n) w = w * n[i];
	if(n.length > 1) w = w / n[n.length - i];
	console.log("0 0 " + w + " 0 0 " + (s / w));
});