{"raw_statement":[{"iden":"statement","content":"The Berland capital is preparing for mayoral election. There are two candidates for the position: the current mayor and his rival. The rival is a serious competitor, and it's not easy for current mayor to win the election. \n\nThe candidate will be declared the winner if he wins at _more_ than a half of _all_ polling stations. The results of the polling stations are supplied independently. The station winner is the candidate who gets _more_ than a half of the votes of this station. No candidate is declared a winner of a polling station if both candidates have got the same number of votes at this station. Similarly, no candidate is declared a winner of the election if both candidates won at the same number of polling stations.\n\nAll eligible voters are going to take part in the election and have already decided whom to give their vote to. The campaign headquarters of the current mayor has collected data from all n stations of the city, and now for every station it is known how many people will vote for the current mayor and how many people will vote for his opponent. \n\nThe results have been disappointing for the current mayor, but his staff came up with a way to win the election. It was suggested to merge some pairs of polling stations in such a way that the current mayor will become the election winner. However, (for the sake of credibility), the proposed plan must comply with two conditions. Firstly, it is possible to merge only the pairs of stations with adjacent numbers (i.e., station j may be merged with either station j - 1, or with station j + 1). The resulting station cannot be merged again. Secondly, the number of such mergers for obvious reasons must be as few as possible. \n\nYour task is to help the current mayor's campaign headquarters and produce such plan.\n\nThe first line contains single integer n (2 ≤ n ≤ 2·105) — the number of the polling stations. \n\nEach of the following n lines contains two integers mj and rj (0 ≤ mj, rj ≤ 105) — the number of voters at station j who plan to vote for the current mayor and his rival correspondingly.\n\nIf current mayor cannot win the election at any condition, print a single number  - 1 to the first line.\n\nOtherwise, to the first line print an integer u — the minimum number of polling station mergers the current mayor needs to perform in order to win. To each of the next u lines print a pair of integers — the numbers of the merged stations. The pairs as well as the numbers within each pair can be printed in any order. If there are multiple solutions, print any of them. \n\n"},{"iden":"input","content":"The first line contains single integer n (2 ≤ n ≤ 2·105) — the number of the polling stations. Each of the following n lines contains two integers mj and rj (0 ≤ mj, rj ≤ 105) — the number of voters at station j who plan to vote for the current mayor and his rival correspondingly."},{"iden":"output","content":"If current mayor cannot win the election at any condition, print a single number  - 1 to the first line.Otherwise, to the first line print an integer u — the minimum number of polling station mergers the current mayor needs to perform in order to win. To each of the next u lines print a pair of integers — the numbers of the merged stations. The pairs as well as the numbers within each pair can be printed in any order. If there are multiple solutions, print any of them. "},{"iden":"examples","content":"Input715 88 1014 1412 1313 1221 1020 30Output21 26 7Input21 55 1Output-1Input210 915 7Output0"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ s \\in \\{ \\text{U}, \\text{F}, \\text{ } \\}^* $ be the encrypted string, with $ 1 \\leq |s| \\leq 10^5 $.\n\n**Constraints**  \nEach character of $ s $ is in $ \\{ \\text{U}, \\text{F}, \\text{ } \\} $.\n\n**Objective**  \nDecrypt $ s $ to recover the original string.  \n\n*(Note: The decryption algorithm is unspecified; formalization requires the mapping. Without it, the objective cannot be mathematically defined.)*","simple_statement":"Decrypt a string made of 'U', 'F', and spaces to get the original message.","has_page_source":false}