Under construction

Still being built. Things may change

Square GG

Time limit1sMemory limit512 MB

Summary
Given N, check whether 100N and 100N+1 are both powerful numbers, and print a square-cube form B^2C^3 for each if they are.
Level

Medium4 of 10

Topics
Math, Number theory, Brute force
Solved
No attempts yet

Problem

Myungjun could not solve the easy problem 제곱 ㄴㄴ, so he made 제곱ㄱㄱ numbers by reversing the 제곱ㄴㄴ numbers.

A positive integer XX is called a 제곱ㄱㄱ number if, for every prime factor pp of XX, p2p^2 is also a divisor of XX. The first 제곱ㄱㄱ numbers are 1, 4, 8, 9, 16, 25, 27, 32, ...

Finding a single 제곱ㄱㄱ number is easy, because any perfect power is one. Myungjun also found that every 제곱ㄱㄱ number can be written as a perfect square multiplied by a perfect cube.

Since finding one 제곱ㄱㄱ number of a given size is easy, Myungjun wants to find cases where two consecutive positive integers are both 제곱ㄱㄱ numbers. Help him check whether such a pair exists at the size he wants.

Input

The first line contains an integer NN (0≤N<10000 \le N < 1000).

Output

Find AA such that both AA and A+1A+1 are 제곱ㄱㄱ numbers and 100N≤A<100N+1100N \le A < 100N+1.

If such an AA exists, print on the first line two positive integers BB and CC with A=B2C3A = B^2C^3.

On the second line, print two positive integers DD and EE with A+1=D2E3A+1 = D^2E^3.

If several values of AA satisfy the condition, print the answer for any one of them.

If no such AA exists, print -1 on the first line and stop.

Examples2

  1. Example 1

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

    Input
    1
    
    Expected output
    5 3
    26 1