#CCBCHBAHAI0000121. Mảng không thể gán toàn bộ bằng dấu = (Whole-Array Assignment Is Not Allowed)

Mảng không thể gán toàn bộ bằng dấu = (Whole-Array Assignment Is Not Allowed)

Whole-Array Assignment Is Not Allowed

Source: C Primer Plus

Version: Phuoc Hung OJ Extended

Problem Statement

In C, an actual array object is not a value that can be assigned as a whole with the = operator after declaration. If a and b are arrays of the same size, a statement such as a = b; is invalid. In contrast, an individual element such as aia_i is an ordinary integer object and can be assigned. To copy all elements of b into a, the program must copy the elements individually or use an appropriate library operation.

This task models three operation types on integer arrays AA and BB, each containing nn elements indexed from 00 to n−1n-1:

  • Type 1 i x: assign Ai=xA_i=x. This assignment is valid and changes AiA_i.
  • Type 2: represent an attempted whole-array assignment A = B. This is invalid in C and does not change the simulated data.
  • Type 3: copy every element of BB into AA, so after the operation Ai=BiA_i=B_i for all 0≤i<n0\le i<n. This operation is valid.

For every operation, print whether it is valid. After all operations, print the final state of AA.

Input

  • The first line contains nn.
  • The second line contains nn integers A0,A1,…,An−1A_0,A_1,\ldots,A_{n-1}.
  • The third line contains nn integers B0,B1,…,Bn−1B_0,B_1,\ldots,B_{n-1}.
  • The fourth line contains qq.
  • Each of the next qq lines describes one operation in one of the forms 1 i x, 2, or 3. For a type-1 operation, 0≤i<n0\le i<n is guaranteed.

Output

For each operation, print one line:

  • VALID for an element assignment or an element-by-element copy;
  • INVALID_ARRAY_ASSIGNMENT for the attempted A = B operation.

After the qq result lines, print A = a0 a1 ... a(n-1) containing the final array AA.

Subtasks

Subtask 1 (100 points): 1≤n≤10001\le n\le1000, 1≤q≤10001\le q\le1000, −109≤Ai,Bi,x≤109-10^9\le A_i,B_i,x\le10^9.

Examples

Input

4
1 2 3 4
10 20 30 40
4
1 2 99
2
3
1 0 -5

Output

VALID
INVALID_ARRAY_ASSIGNMENT
VALID
VALID
A = -5 20 30 40

Explanation

Initially A=(1,2,3,4)A=(1,2,3,4) and B=(10,20,30,40)B=(10,20,30,40).

Operation 1 2 99 assigns one element, so it is valid and changes AA to (1,2,99,4)(1,2,99,4).

Operation 2 represents A = B. Whole-array assignment is invalid in C, so the simulated array does not change.

Operation 3 copies the elements of BB one by one, producing A=(10,20,30,40)A=(10,20,30,40).

Finally, 1 0 -5 sets A0=−5A_0=-5, so the final array is (−5,20,30,40)(-5,20,30,40).