PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000199. Biểu diễn bằng tổng các số liên tiếp (Consecutive Sums)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Biểu diễn bằng tổng các số liên tiếp (Consecutive Sums)

Biểu diễn bằng tổng các số liên tiếp (Consecutive Sums)

Source: Kattis

Version: Phuoc Hung OJ Extended

Problem Statement

Given positive integer NN, express it as a sum of at least two consecutive positive integers. If several representations exist, choose the one with the fewest summands. Output the full equation N = a + (a+1) + ... + b with every term actually listed, or print IMPOSSIBLE if none exists.

Input

A single positive integer NN.

Output

Print the full equation on one line, or IMPOSSIBLE.

Subtasks

  • Subtask 1 (20 points): 1≤N≤100001\le N\le 10000.

  • Subtask 2 (30 points): 1≤N≤10000001\le N\le 1000000.

  • Subtask 3 (50 points): 1≤N≤10000000001\le N\le 1000000000.

Examples

Example 1

Input

10

Output

10 = 1 + 2 + 3 + 4

Explanation

The representation 10=1+2+3+410=1+2+3+4 is the unique sum of at least two consecutive positive integers.

Example 2

Input

24

Output

24 = 7 + 8 + 9

Explanation

The shortest representation is 24=7+8+924=7+8+9, which has three summands. No two consecutive positive integers sum to 2424.

Example 3

Input

8

Output

IMPOSSIBLE

Explanation

A power of two cannot be expressed as a sum of two or more consecutive positive integers.