프로그램 명: ncpc_moose
제한시간: 1 초

All moose are knigs of the forest, but your latest moose-friend, Karl-Algtav, is more interesting than most. In part because of his fondness of fermented blueberries, and in part because of the tribe he lives in. Each year his tribe holds a tournament to determine that year's alphamoose. The winner gets to mate with all the moose-chicks, and then permanently leaves the tribe. The pool of contenders stays constant over the years, apart from the old alpha-moose being replaced by a newcomer in each tournament.

KarlAlgtav has recently begun to wonder when it will be his turn to win all the chicks, and has asked you to help him determine this. He has supplied a list of the strength of each of the other male moose in his tribe that will compete during the next n-1 years, along with their time of entry into the tournament. Assuming that the winner each year is the moose with greatest strength, determine when KarlAlgtav becomes the alpha-moose.

입력

The first line of input contains two space separated integers k (1 <= k <= 10^5) and n (1 <= n <= 10^5), denoting the size of the tournament pool and the number of years for which you have been supplied suppliedcient information.
Next is a single line describing KarlAlgtav, containing the two integers y (2011 <= y <= 2011 + n - 1) and p (0 <= p <= 2^31 - 1). These are his year of entry into the tournament and his strength, respectively.
Then follow n + k - 2 lines describing each of the other moose, in the same format as for KarlAlgtav.

Note that exactly k of the moose will have 2011 as their year of entry, and that the re- maining n - 1 moose will have unique years of entry.
You may assume that the strength of each moose is unique.

출력

The year KarlAlgtav wins the tournament, or unknown if the given data is insucient for determining this.

입출력 예

입력

2 4
2013 2
2011 1
2011 3
2014 4
2012 6

출력

2013

입력

2 4
2011 1
2013 2
2012 4
2011 5
2014 3

출력

unknown
출처: The 2011 Nordic Collegiate Programming Contest problem F

[질/답] [제출 현황] [푼 후(1)]
[ 채 점 ] [홈으로]  [뒤 로]