Good Host#12266

Good Host

2 seconds
256 megabytes
Very hard

You're hosting a concert. The concert stadium has doors numbered through , and door has an initial cost a_i and height h_i. If a person meters tall enters through the -th door, it costs them a_i + \dfrac{|h_i - x|}{c}.

You know the values and , as well as all the information about the doors. As the host, you must process events of two types:

Input

The first line contains two integers (1 \leq n \leq 2 \cdot 10^5, 1 \leq c \leq 10^9).

The second line contains integers a_1, a_2, \dots, a_n (1 \leq a_i \leq 2 \cdot 10^5).

The third line contains integers h_1, h_2, \dots, h_n (1 \leq h_i \leq c).

The fourth line contains an integer (1 \leq q \leq 2 \cdot 10^5).

The following lines are in one of these two formats:

  • (1 \leq x \leq c).

  • (1 \leq i \leq n, 1 \leq b \leq 2 \cdot 10^5, 1 \leq d \leq c).

Output

For every event of type , output the number of the door that costs the least. If there are multiple possible doors, output any of them.

Examples

Example 1

Loading
Loading

Scoring

  1. Subtask ( points): 1 \leq n, q \leq 1000

  2. Subtask ( points): c = 1

  3. Subtask ( points): no additional constraints.