S = gets.to_i
x = Array.new(3)
y = Array.new(3)
x[0] = 0; y[0] = 0;
x[1] = Math.sqrt(S).to_i; y[2] = Math.sqrt(S).to_i;
x[2] = 1; y[1] = S - x[1] * y[2];
printf("%d %d %d %d %d %d", x[0], y[0], x[1], y[1], x[2], y[2]);
