Conscription
To organize a campaign on Azeroth Orgrim Doomhammer needs one more squad. On war appeal arrived orcs. Doomhammer immediately estimated the abilities of each orc in close combat and javelin throw. Now he must determine which of them to be appointed soldier-infantryman (grunt), and who the bounty hunter (headhunter). At the same time, in order for the troop to be combat-ready, it is necessary that the troop should have at least grunts and at least headhunters. After determining each orc into some type of troop, the strength of all troop can be determined as the sum of abilities of all orcs in the specialization assigned to them.
Write a program that determines the maximum possible strength of the newly created troop.
Input
First line contains three integers . Then lines are given, each of them contains two integers in the interval from to — the ability of the corresponding orc in close combat (grunt) and his ability to throw a spear (headhunter).
Output
Print the maximum strength of the battle-worthy army that can be created from conscripts. If you can not create an army that satisfies the given conditions, print the number .