S = gets.to_i
x = Array.new(3)
y = Array.new(3)
x[0] = 0; y[0] = 0;
if S == 10**18
    x[1] = 10**9; y[1] = 0; x[2] = 0; y[2] = 10**9
else
    x[1] = Math.sqrt(S).to_i + 1; y[2] = Math.sqrt(S).to_i + 1;
    a = S - (x[1] * y[2])
    x[2] = 1; y[1] = -a;
end
printf("%d %d %d %d %d %d", x[0], y[0], x[1], y[1], x[2], y[2]);
