Submit solution

Points:
15

Time limit:
1.0s

Java
2.0s

Python
4.0s

Memory limit:
1G

Author:

Problem type

Levve loves segment trees, so he has given you the following task:

You are given an array of **zeroes** and operations of the following forms:

`C x v`

: Change the element's value at index to .`S l r`

: Output the sum of all elements between indices and , inclusive.`M l r`

: Output the maximum of all elements between indices and , inclusive.

Levve doesn't like cheesing, so you will not be given , , or directly. Instead of , you will be given , which can be decrypted using the formula where represents the output to the previous `S`

or `M`

query, and represents the bitwise xor operation. If there is no previous output, .

Similarly:

#### Constraints

#### Input Specification

The first line contains two space-separated integers, and .

The following lines each contain a query of one of the previously described forms.

#### Output Specification

For each `S`

or `M`

query, output its result on a new line.

#### Sample Input

```
10 5
C 2 1
C 7 3
S 1 5
C 2 9
M 2 8
```

#### Sample Input (Unencrypted)

```
10 5
C 2 1
C 7 3
S 1 5
C 3 8
M 3 9
```

#### Sample Output

```
1
8
```

## Comments

Since the original data were weak, an additional test case was added, and all submissions were rejudged.