Groups 1#9015

Groups 1

1 second
64 megabytes
Very easy

In Zhitoland, children's phones have been taken away, prompting them to rediscover friendships. Initially, all children have forgotten about each other, so no one is friends with anyone else.

There are children living in the city, each identified by a unique number from to .

Initially, each child forms their own group.

You are given an array of size , where a_i denotes the influence of child .

Akia and Gulnar need your help to determine which group has the greatest influence. They will provide you with queries.

There are two types of queries:

The influence of a newly formed group is the sum of the influences of the groups containing children and .

Input

The first line contains two integers and (1 \le n, q \le 2 \times 10^5).

The second line contains integers a_1, a_2, \ldots, a_n (1 \le a_i \le 10^9).

Each of the following lines contains a query.

Output

For each query of type , output the answer as specified above.

Examples

Example 1

Loading
Loading