Upgrade of the Zhuge Liang words Confucianism upgrade
Faced with Zhuge Liang words Confucianism of Zero, Three-God wants to upgrade it , just bacause it's such an easy problem and do not suitable for you ~ ~ ~
Zhuge Liang's IQ is N, every duel will reduce Zhuge liang's IQ ~ ~ ~
To win for Shu country，Zhuge Liang must win as more enemies as he can，and let the defeated enemies's name order by lexicographic。
This problem contains several cases.
The first line of each case is two integers N and M. (0 < N < 2^32 0 < M < 10000)
Then follows the M lines.
Each line is two integers Name and The IQ.(The name is a string of 1 20 letters.0 < IQ < 2^32);
Printf the number of Zhugeliang has be win , and all name that has be lost by Geliang Zhu by lexicographic order.