Data Structure Problem
题号:NC213130
时间限制:C/C++/Rust/Pascal 3秒,其他语言6秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Bobo has two sequences and . He would like to perform the following operations:

+ , change the value of a_x to y.
+ , change the value of b_x to y.
+ , find the value of c_x, where , .

输入描述:

The input consists of several test cases terminated by end-of-file. For each test case:

The first line contains two integers n and m , which are the length of the two sequences and the number of operations. The second line contains n integers . The third line contains n integers . Each of the last m lines contains a query.

*
*
*
* The sum of n and the sum of m do not exceed .

输出描述:

For each query of , output an integer denoting the value of c_x.
示例1

输入

复制
4 9
1 2 3 3
-1 2 3 3
3 1
3 2
3 3
3 4
2 2 -4
3 1
3 2
3 3
3 4

输出

复制
1
3
6
9
1
2
5
8