Implement a data structure that manages a set of integers, supporting the following operations:
add(i) - Add the integer to the set . If is already in the set, no changes are made.
sum(l, r) - Calculate and output the sum of all elements in that satisfy the condition l \leq x \leq r.
Initially, the set is empty. The first line of the input contains , the number of operations (1 \leq n \leq 100). The following lines describe the operations. Each operation is either "+ i" or "? l r". The operation "? l r" corresponds to the query sum(l, r).
If a "+ i" operation appears at the start of the input or immediately after another "+" operation, it corresponds to add(i). However, if it follows a "?" query, and the result of that query was , then the operation \text{add}((i + y) \bmod 10^9) is executed.
All parameters in the queries and addition operations range from to 10^9.
For each query, output a single number, which is the result of the query.
Example 1