Bob lives in an ancient village, where transactions are done by one item exchange with another. Bob is very clever and he knows what items will become more valuable later on. So, Bob has decided to do some business with villagers.

At first, Bob has `N` kinds of items indexed from 1 to `N`, and each item has `A _{i}`.
There are

There are multiple test cases.

For each test case: the first line contains two integers: `N` and `M`
(1 <= `N`, `M` <= 100).

The next `N` lines contains two integers: `A _{i}` and

Following

There is one empty line between test cases.

提交代码