#CCBCHBAHAI0000124. Mảng cục bộ chưa khởi tạo (Uninitialized Local Array)

Mảng cục bộ chưa khởi tạo (Uninitialized Local Array)

Uninitialized Local Array

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem Statement

A local integer array aa with nn elements is created without an initializer. Initially, no element is considered to contain a defined value that the program may use.

Then mm assignments are performed. Each assignment gives an index ii and a value xx, meaning ai=xa_i=x. An element assigned at least once becomes defined; if the same index is assigned multiple times, the latest value is kept.

Finally, qq element reads are requested. For each requested index, print its current value if it has been assigned. If it has never been assigned, do not read or guess its value; print INDETERMINATE instead.

Input

  • The first line contains nn and mm.
  • Each of the next mm lines contains ii and xx, representing the assignment ai=xa_i=x.
  • The next line contains qq.
  • The final line contains exactly qq indices to inspect.

Every input index lies in [0,n−1][0,n-1].

Output

For each requested index, print one line containing either its current assigned value or INDETERMINATE if it has never been assigned.

Subtasks

Subtask 1 (100 points): 1≤n≤10001\le n\le1000, 0≤m≤10000\le m\le1000, 1≤q≤10001\le q\le1000, −109≤x≤109-10^9\le x\le10^9.

Examples

Input

6 3
0 7
2 -4
5 9
6
0 1 2 3 4 5

Output

7
INDETERMINATE
-4
INDETERMINATE
INDETERMINATE
9

Explanation

The array has 66 elements. The assignments define a0=7a_0=7, a2=−4a_2=-4, and a5=9a_5=9.

The queries inspect indices 0,1,2,3,4,50,1,2,3,4,5. Only indices 0,2,50,2,5 have been assigned, so the other positions must be reported as INDETERMINATE instead of reading an uninitialized value.