Problem hidden

BLOPER2 - Operators (new ver)

Given a sequence a1, a2 ... an and a integer S, your task is find a way to insert an operator ‘+’ , ‘-‘, ‘.‘, ‘~‘  to every neighbor pair of A, that the result of the expression after insert equal to S.

Note that :

  • a . b = a + 2 * b
  • a ~ b = a - 2 * b

Input

First line : N and S (2 ≤ N ≤ 22, |S| ≤ 5 * 1016)

Second line : N integers, a1, a2 ... an  (|ai| ≤ 1015)

Output

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

Example

Input:
9 5
1 2 3 4 5 6 7 8 9

Output:
-~~~++++
Input:
3 -1
-2 5 7

Output:
Impossible

Details:

In first test case : 1 - 2 - 2 * 3 - 2 * 4 - 2 * 5 + 6 + 7 + 8 + 9 = 5

You may want to try another version here.


Adicionado por:Kata
Data:2014-03-30
Tempo limite:1.5s
Tamanho do fonte:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Linguagem permitida:Todas exceto: ASM64 CLOJURE ERL FSHARP PERL6 PY_NBC SCALA TCL
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.