Simple Sum#8274

Simple Sum

1 second
64 megabytes
Easy

Given an array with elements, your task is to compute the sum of numbers within a specified segment.

Input

The first line of input consists of two integers, and , representing the number of elements in the array and the number of queries, respectively. (1 \leq N \leq 10^6); (1 \leq K \leq 10^5). The next lines contain the queries, which are of two types:

  1. A – Set the -th element of the array to the value (1 \leq i \leq N; 0 \leq x \leq 10^9).

  2. Q – Calculate the sum of the elements in the array from position to . (1 \leq l \leq r \leq N).

Initially, all elements of the array are zero.

Output

For each query of the form Q , output a single number representing the sum of the elements in the specified segment.

Examples

Example 1

Loading
Loading