Problem Description

Read n integers. Store the first index (1-based) for each distinct value. Then q queries follow, each query is a value. Output its first index or -1.

Input Format

Line1: n. Line2: n integers. Line3: q. Next q lines: value.

Output Format

q lines indices.

Sample Test Case

Input:
5 10 20 10 30 20 4 10 20 30 40
Output:
1 2 4 -1

Constraints

n,q

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next