The Association of Chess Monsters (ACM) is planning its annual match against the rest of the world. The match will take place on boards: players will play with white pieces, and players will play with black pieces. ACM has many players to choose from and wants to form the strongest team. Each player's ability for playing with white pieces is measured on a scale from to , and the same rule applies for playing with black pieces. In the match, a player can only play with either white or black pieces, not both. The team's total strength is the sum of the abilities of the players assigned to white and the abilities of the players assigned to black. Help ACM select a team with the highest possible total strength.
The input consists of a sequence of lines, each containing the abilities of one player as two integers separated by a space: the first integer is the ability for white, the second is for black. There will be at least and at most lines in the input.
Output a single integer—the highest possible total strength of the ACM team.
Example 1