Under construction

Still being built. Things may change

Math Teacher's Worry (Easy)

Time limit1sMemory limit1024 MB

Summary
For a given n, factor n x^2 + (n+1)x - (n+2) over the integers and print the coefficients, or print -1 if no factorization exists.
Level

Easy3 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

This problem is a subproblem of Math Teacher's Worry (Hard), and you can solve it by submitting the correct code for Math Teacher's Worry (Hard).

Teacher Cha Hyeong-jun, as usual, was puzzling over an interesting problem. He came up with a task: factor the quadratic nx2+(n+1)x−(n+2)n x^2 + (n+1) x - (n+2) over the integers, where nn is a positive integer.

He could work out small values of nn by hand, but the problem became harder as nn grew.

So the teacher gave the problem to Do-hoon, who is not strong at math but follows instructions and writes code. However, Do-hoon has only copied and pasted code that ChatGPT gave him, and he can barely print "Hello World!". So he asked ChatGPT to write the code, as usual.

The internet went down while he was waiting for the answer.

The screen shows the moment the internet cut out while Do-hoon was asking ChatGPT to write a program.

Help Do-hoon write a program that factors nx2+(n+1)x−(n+2)n x^2 + (n+1) x - (n+2) over the integers.

Input

The first line contains a positive integer nn.

Output

If the quadratic nx2+(n+1)x−(n+2)n x^2 + (n+1) x - (n+2) cannot be factored over the integers for the given nn, print -1. Otherwise, print four integers aa, bb, cc, and dd separated by spaces. These four integers mean (ax+b)(cx+d)=nx2+(n+1)x−(n+2)(ax+b)(cx+d)=n x^2 + (n+1) x - (n+2). If there are several valid (a,b,c,d)(a,b,c,d) pairs, print any of them.

Constraints

1≤n≤5 0001\le n\le 5\,000.

Examples2

  1. Example 1

    Input
    1
    
    Expected output
    1 -1 1 3
    
  2. Example 2

    Input
    2
    
    Expected output
    -1