Suki's Activity Intervals
Suki keeps a detailed log of her daily activities, each marked with a start time and an end time. Her activities include napping in sunny spots, digging in the garden, fetching pink balls, and waiting by the door for her walk.
Given her activity log and several query times, determine which activity Suki was doing at each query time. If no activity was happening at a query time, she was idle.
Input
The first line contains n and q (1 ≤ n ≤ 2·10^5, 1 ≤ q ≤ 2·10^5), the number of activities and queries.
The next n lines each contain three integers: id, start, and end (1 ≤ id ≤ n, 0 ≤ start < end ≤ 10^9), where id is the activity identifier, start is the start time (inclusive), and end is the end time (exclusive).
The last q lines each contain one integer t (0 ≤ t < 10^9), a query time.
Activities are given in no particular order. Activity IDs are distinct. An activity is ongoing at time t if start ≤ t < end.
Output
For each query time, print the ID of the activity happening at that time, or print IDLE if no activity was happening.
Notes
Suki's activities do not overlap. Each query time is handled independently.