Problem Description

Read n pairs key value. If a key appears many times, keep the last value. After all pairs, output value for query key, or NA if key never appeared.

Input Format

First line n. Next n lines: key value. Last line: queryKey.

Output Format

One line value or NA.

Sample Test Case

Input:
4 a 10 b 5 a 7 c 2 a
Output:
7

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next