#SGM0000005. Dấu của tích trên đoạn (Interval Product)

Dấu của tích trên đoạn (Interval Product)

Interval Product

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

Given a sequence X1,X2,…,XNX_1,X_2,\ldots,X_N, process KK commands. C I V changes XIX_I to VV. P I J asks whether XIXI+1⋯XJX_I X_{I+1}\cdots X_J is positive, negative, or zero.

Input

  • The first line contains NN and KK.
  • The second line contains NN integers XiX_i with −100≤Xi≤100-100 \le X_i \le 100.
  • Each of the next KK lines is C I V or P I J. For C, 1≤I≤N1 \le I \le N and −100≤V≤100-100 \le V \le 100. For P, 1≤I≤J≤N1 \le I \le J \le N. At least one P command is present.

Output

Print one line whose characters correspond to the P commands: + for a positive product, - for a negative product, and 0 for a zero product.

Subtasks

  • Subtask 1 — 20%: 1≤N,K≤10001 \le N,K \le 1000.
  • Subtask 2 — 30%: 1≤N,K≤500001 \le N,K \le 50000.
  • Subtask 3 — 50%: 1≤N,K≤1051 \le N,K \le 10^5.

Examples

Input

4 6
-2 6 0 -1
C 1 10
P 1 4
C 3 7
P 2 2
C 4 -5
P 1 4

Output

0+-

Explanation

After C 1 10, range [1,4][1,4] still contains the zero at position 33, so the first character is 0. After C 3 7, P 2 2 examines only 6>06>0, giving +. Finally X4=−5X_4=-5, so 10⋅6⋅7⋅(−5)10\cdot6\cdot7\cdot(-5) is negative and gives -.