Under construction

Still being built. Things may change

House Numbers

Interview

Time limit1sMemory limit512 MB

Summary
Given the first house number m, find the smallest n and the house x whose left and right neighbours' numbers sum equally.
Level

Medium5 of 10

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

Problem

Peter was walking down the street and noticed that the houses on the street were numbered consecutively from mm to nn. Standing in front of a particular house xx, he also noticed that the sum of the house numbers behind him (numbered from mm to x−1x-1) was equal to the sum of the house numbers in front of him (numbered from x+1x+1 to nn).

Given mm, and assuming there are at least three houses, find the smallest nn for which this is possible.

Input

The input consists of a single line containing the integer mm (1≤m≤1,000,0001 \le m \le 1{,}000{,}000).

Output

On a single line, print mm, xx, and nn, in that order, separated by spaces.

It is guaranteed that a solution exists with n≤10,000,000n \le 10{,}000{,}000.

Examples4

  1. Example 1

    Input
    1
    
    Expected output
    1 6 8
    
  2. Example 2

    Input
    11
    
    Expected output
    11 49 68
    
  3. Example 3

    Input
    999999
    
    Expected output
    999999 1317141 1571535
    
  4. Example 4

    Input
    999000
    
    Expected output
    999000 1000000 1000999