A telemetry store keeps a timeline of string values for each key. It processes q operations, each one of:
SET key val t— record that at timet, keykeyheld valueval. For any fixed key, theSEToperations arrive with strictly increasing timestamps.GET key t— report the value thatkeyheld at the greatest recorded time that is less than or equal tot. If the key has no recorded value at a time<= t, report*.
Keys and values are non-empty tokens of lowercase letters and digits.
Input format
Line 1: an integer q.
Next q lines: SET key val t or GET key t.
Output format
For each GET operation, in order, print the resolved value, or * if none applies.
Constraints
- 1 <= q <= 40
- 0 <= t <= 1000000
- 1 <= length of key, val <= 12