BLOPER - Operators


Given a set of N integer A = {1, 2, 3, …, N} and a integer S, your task is find a way to insert an operator ‘+’ or ‘-‘ to every neighbor pair of A, that the result of the expression after insert equal to S.

Input

A single line, N and S (1 ≤ N ≤ 500, |S| ≤ 125250)

Output

If there are way(s) to insert, outputs any of them, otherwise outputs “Impossible” (without quotes).

Example

Input:
9 5

Output:
1-2+3-4+5-6+7-8+9
Input:
5 6

Output:
Impossible

hide comments
smap: 2020-09-03 16:24:39

what is test 25 ??!!! my solution fails on it

Shubham Jadhav: 2020-07-17 22:52:37

lots of silly mistakes

seventh_sky: 2020-06-28 09:44:31

getting wrong ans for test25 help odd and even cases working properly

prudhvi_495: 2019-06-11 04:11:53

For those who are getting WA on 23, check (even, 0) pairs with different even numbers like 4,6. 4 will have the solution but 6 don't have. For those getting WA on 25 try (odd, 0) cases.

jonathanzong: 2017-09-06 22:52:49

Last edit: 2017-10-05 15:44:17
blaskwolf: 2017-07-19 19:06:10

for case 25 check something like 7 0 or 3 0
Regards,

poorya: 2017-06-30 21:38:30

i don't know why wrong answer on case upper than 20

root_rohit: 2017-04-06 15:33:34

How do I know on which test case my code failed?

heptathlon123: 2016-11-27 10:30:03

what is 5 and 6?

haitran204: 2016-10-21 16:30:58

Last edit: 2016-10-21 16:43:58

Added by:Kata
Date:2014-03-28
Time limit:0.100s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64