Under construction

Still being built. Things may change

Sum of consecutive numbers

Time limit5sMemory limit256 MB

Summary
Write each N up to 1e9 as the shortest sum of two or more consecutive positive integers, or print IMPOSSIBLE.
Level

Medium5 of 10

Topics
Math, Number theory
Solved
No attempts yet

Problem

Some numbers are a sum of two or more consecutive positive integers, and some numbers are not.

Given an integer NN, write NN as a sum of two or more consecutive positive integers. For example, 10=1+2+3+410 = 1 + 2 + 3 + 4 and 24=7+8+924 = 7 + 8 + 9.

If several sums exist, print the one with the fewest terms. Once the number of terms is fixed the first term is fixed too, so the shortest sum is unique.

Input

The first line contains the number of test cases TT (1≤T≤1001 \le T \le 100).

Each of the next TT lines contains one integer NN (1≤N≤1091 \le N \le 10^9).

Output

Print one line for each test case. If the shortest sum runs from aa to bb, join all of its terms in this format.

N = a + (a+1) + ... + b

Put one space on each side of the equals sign and of every plus sign. If no such sum exists, print IMPOSSIBLE.

Examples2

  1. Example 1

    Input
    3
    8
    10
    24
    
    Expected output
    IMPOSSIBLE
    10 = 1 + 2 + 3 + 4
    24 = 7 + 8 + 9
    
  2. Example 2

    Input
    7
    1
    2
    3
    4
    5
    6
    7
    
    Expected output
    IMPOSSIBLE
    IMPOSSIBLE
    3 = 1 + 2
    IMPOSSIBLE
    5 = 2 + 3
    6 = 1 + 2 + 3
    7 = 3 + 4