This page is still under construction.

Parts of this page are still being built. What you see may change.

Integer Square

Interview

Time limit2sMemory limit512 MB

Summary
Given an integer area s, decide whether a square with integer-coordinate vertices can have that area, and if so output the four vertices.
Level

Medium5 of 10

Topics
Math, Number theory, Geometry, Implementation
Solved
No attempts yet

Problem

Iris likes to draw different shapes on a grid paper. Her favorite shape is a square. She has recently tried to draw a square with area ss, but since she uses a grid paper, she wants all the vertices of the square to have integer coordinates.

Can you help her find such a square?

Input

The input contains a single integer ss (1≤s≤10001\le s\le 1000).

Output

If it is possible to construct the required square, output four pairs of integers: the coordinates of the vertices of the square, in any order. All coordinates should be in the range from −109-10^9 to 10910^9. If there are multiple answers, output any of them.

If it is impossible to construct the required square, print "Impossible".

Examples2

  1. Example 1

    Input
    5
    
    Expected output
    2 4
    3 2
    4 5
    5 3
    
  2. Example 2

    Input
    3
    
    Expected output
    Impossible