const
	MaxN = 1000010;

var
	inFile, outFile : text;
	rowNum, colNum, x, y, n, i : longint;
	m : array[0..MaxN] of boolean;
	sol, curr : int64;
	
procedure resetMatrix(rows, cols : longint);
begin
	fillchar(m, sizeof(m), false);
	rowNum := rows;
	colNum := cols;
end;

function get(i, j : longint) : boolean;
begin
	get := m[(i - 1) * colNum + (j - 1)];
end;

procedure put(i, j : longint; val : boolean);
begin
	m[(i - 1) * colNum + (j - 1)] := val;
end;

function count(X, Y : longint) : int64;
var
	X1, Y1, sol : int64;
	i, j, dx, dy : longint;
begin
	X1 := X; Y1 := Y;
	sol := 2 * (X1 * (Y1 - 1) + Y1 * (X1 - 1));

	resetMatrix(X, Y);
	for i := 1 to X - 1 do
		for j := 1 to Y - 1 do
			if (NOT get(i, j)) then
			begin
				sol := sol + 4*(X1 - i)*(Y1 - j);
				dx := i; dy := j;
				while ((dx < X) and (dy < Y)) do
				begin
					put(dx, dy, true);
					dx := dx + i; dy := dy + j;
				end;
			end;

	count := sol;
end;

BEGIN

	assign(inFile, 'vojnici.in');
	assign(outFile, 'vojnici.out');
	reset(inFile); rewrite(outFile);
	
	readln(inFile, n);
	sol := 0;
	i := 1;
	
	while (i * i <= n) do
	begin
		if (n mod i = 0) then
		begin
			curr := count(i, n div i);
			if (curr > sol) then
			begin
				sol := curr;
				x := i; y := n div i;
			end;
		end;
		i := i + 1;
	end;

	writeln(outFile, x, ' ', y, ' ', sol);
	close(inFile);
	close(outFile);

END.
