program agc036a
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int64):: s,x1,y2,xy,i,x2,y1


    read*, s
    x1 = ceiling(sqrt(dble(s)))
    y2 = x1

    xy = x1*y2 - s

    do i=ceiling(sqrt(dble(xy))),1,-1
        if (mod(xy,i) == 0) then
            x2 = i
            y1 = xy/x2
            exit
        end if
    end do

    print'(*(i0,1x))',0,0,x1,y1,x2,y2

end program agc036a