Hasty Santa Claus

아직 제출이 없습니다시간 제한2초메모리 제한1024 MB

문제

Hasty Santa Claus has arrived at the town on December 1st. Realizing that it is a little bit too early for Christmas, he plans to leave the presents before (or even after) Christmas while families are out on vacation trips.

Santa knows which families depart and return on which days, but he can visit only a limited number of houses a day. He is stuck with finding which houses are to be visited on which days to distribute the presents to every family. Please help him solving the problem, not only for Santa but also for kids anxiously awaiting for the presents!

입력

The input consists of a single test case of the following format.

nn kk

a_1a\_1 b_1b\_1

\vdots

a_na\_n b_nb\_n

The first line has two positive integers, nn and kk, the number of houses to leave the presents and the maximum number of houses that Santa Claus can visit a day, respectively.

The ii-th line of the following nn lines has two positive integers a_ia\_i and b_ib\_i. They indicate that he can visit the ii-th house between the a_ia\_i-th and b_ib\_i-th days, inclusive.

nn and kk satisfy 1kn10001 ≤ k ≤ n ≤ 1000. For each ii, a_ia\_i and b_ib\_i satisfy 1a_i25b_i311 ≤ a\_i ≤ 25 ≤ b\_i ≤ 31.

출력

Print nn lines of one integer describing a plan for Santa to complete his task. The integer on the i-th line means the date on which Santa should visit the ii-th house.

At least one solution is guaranteed to exist. If there are two or more solutions, any of them is accepted.

힌트

The first sample is depicted in the figure below. Santa can leave the presents during the periods shown as horizontal lines with short vertical markers at both ends. For the House 4, Santa can visit only on a specific day. The triangles show the days on which Santa should visit each house.

Figure A.1. Sample 1