Interval Product#4082

Interval Product

2 seconds
122.174 megabytes
Very easy

It's normal to feel worried and tense the day before a programming contest. To relax, you met with some friends and decided to play a game to keep your mind sharp for the next day. To start, your friends will give you a sequence of integers x_1, x_2, \ldots, x_n. Then, there will be rounds; in each round, your friends will issue a command, which can be:

- a change command, when your friends want to change one of the values in the sequence; or - a product command, when your friends give you two values , and ask you if the product x_i \times x_{i+1} \times \ldots \times x_{j-1} \times x_j is positive, negative, or zero.

You want to answer all the questions correctly, so you decide to rely on your programming skills. Fortunately, your friends allow you to use your notebook to write a program to help you in the game.

Input

Each test case is described using several lines. The first line contains two integers and (1 \leq n, k \leq 10^5), indicating respectively the number of elements in the sequence and the number of rounds of the game.

The second line contains integers x_i that represent the initial values of the sequence (-100 \leq x_i \leq 100 for i = 1, 2, \ldots, n).

Each of the next lines describes a command and starts with an uppercase letter that is either C or P.

If the letter is C, the line describes a change command, and the letter is followed by two integers and indicating that x_i must receive the value (1 \leq i \leq n, -100 \leq v \leq 100).

If the letter is P, the line describes a product command, and the letter is followed by two integers and indicating that the product from x_i to x_j, inclusive, must be calculated (1 \leq i \leq j \leq n).

Within each test case, there is at least one product command.

Output

For each test case, output a line with a string representing the result of all the product commands in the test case. The -th character of the string represents the result of the -th product command. If the result of the command is positive, the character must be + (plus); if the result is negative, the character must be - (minus); if the result is zero, the character must be 0 (zero).

Examples

Example 1

Loading
Loading