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

#QHD0000057. Sổ thu chi (Account Book)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Sổ thu chi (Account Book)

Account Book

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

A book page lists nn positive transaction amounts tit_i in chronological order. The sign of each transaction has been erased: it could be an income (+) or an expense (-). However, the exact signed net cash flow FF is known; it may be positive, negative, or zero.

An assignment is valid when every transaction receives one sign and the signed sum equals FF. Determine what can be concluded about each transaction across all valid assignments, not just across one arbitrary solution.

For transaction ii, print + if it is income in every valid assignment, - if it is expense in every valid assignment, and ? if both possibilities occur among valid assignments. If no assignment exists at all, print * instead of the sign string. Equal transaction amounts at different positions remain distinct transactions.

Input

The first line contains nn and FF. Each of the next nn lines contains one positive transaction amount tit_i. There is no terminating 0 0 line.

Output

If there is no valid sign assignment, print *. Otherwise print exactly nn characters, the ii-th being +, -, or ? according to the definition, without spaces.

Subtasks

  • Subtask 1 (20 points): 2≤n≤102\le n\le10, −16000≤F≤16000-16000\le F\le16000, 1≤ti≤301\le t_i\le30 for every ii.

  • Subtask 2 (30 points): 2≤n≤252\le n\le25, −16000≤F≤16000-16000\le F\le16000, 1≤ti≤2001\le t_i\le200 for every ii.

  • Subtask 3 (50 points): 2≤n≤402\le n\le40, −16000≤F≤16000-16000\le F\le16000, 1≤ti≤10001\le t_i\le1000 for every ii.

Examples

Input


5 7
1
2
3
4
5

Output


?+??+

Explanation

For amounts 1,2,3,4,51,2,3,4,5 and required sum 77, the second and fifth transactions are positive in every valid assignment. The first, third, and fourth transactions can have either sign in different valid assignments. The output is ?+??+. A target of 100100 would be impossible because the sum of all positive amounts is only 1515, and the output would then be *.