#0000CE

z-trees

Memorial Drive is known to have a lot of trees along it. The street is made of concrete blocks, and some blocks have a hole in it from which a tree is growing. Also every block has a "Tree detector" that can detect the number of trees round (and at) that block.


Mister Little Z. had never been to memorial drive, but he found the data for all the detectors online.


For each of the N (1 <= N <= 400) blocks he know the power of the detector at that block Pi and the amount of trees the detector has detected Ci. Pi represents the maximal distance in blocks at which the detector detects a tree (if it equals 0, then the detector can only detect a tree on it's own block, and if it equals to one, then it can detect trees on previous block, its own block and the next block, you get the idea). Since every block can have at most one tree it will always be true that 0 <= Ci <= 2*Pi + 1, and Pi <= N


Your job is to help Little Z generate one possible tree arrangement so that the data he obtained from the internet "fits" correctly


InputFrom the first line of the standard input read one integer N, the number of blocks. Each of the next N lines contains two integers, the detector range (power), and the number of detected trees of corresponding detector.

OutputTo the standard output you should write one possible arrangement of the trees. To the first line write an integer M, the number of trees on Memorial Drive, and on each of the next M lines write the position of the tree. The indices start from 0 - the position of the first block is 0, and the position of the last block is N-1


Input:
3
1 1
1 1
1 1

Output:
1
1



Input:
3
2 1
1 1
2 1

Output:
1
0

Explanation: in this case we can have only one tree, but it can be located at any of the blocks 0 to N-1

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.