#K70997. Bread Loaf Readiness Monitoring

    ID: 33432 Type: Default 1000ms 256MiB

Bread Loaf Readiness Monitoring

Bread Loaf Readiness Monitoring

You are given n loaves of bread undergoing fermentation. Each loaf is identified by a unique identifier and a fermentation finishing time in seconds. You are also given the current time in seconds. A loaf is considered to be ready if its fermentation finishing time t satisfies

\( current\_time \leq t \leq current\_time + 3600 \)

Your task is to determine which loaves will be ready within the next hour. Output the list of loaf identifiers sorted in increasing order of their fermentation finishing time. If no loaf meets the criteria, output an empty line.

inputFormat

The first line of input contains two integers: n (the number of loaves) and current_time (the current time in seconds).

This is followed by n lines, each containing two integers: the loaf_id and its fermentation finishing time in seconds.

All inputs are provided via standard input (stdin).

outputFormat

Output a single line containing the identifiers of the loaves that will be ready within the next hour, sorted by their fermentation finishing time. The identifiers should be separated by a single space. If no loaf is ready, output an empty line.

Output the result to standard output (stdout).

## sample
3 1800
1 3600
2 4500
3 7200
1 2