Conscription#182

Conscription

1 second
128 megabytes
Easy

To prepare for the campaign on Azeroth, Orgrim Doomhammer needs an additional squad. In response to the conscription, orcs arrived. Doomhammer immediately evaluated each orc's abilities in close combat and javelin throwing. Now, he must decide which orcs to assign as infantry soldiers (grunt) and which as spear-throwers (headhunter).

For the squad to be considered battle-ready, it must include at least grunts and at least headhunters. After assigning each orc to a specialization, the total strength of the squad is calculated as the sum of the abilities of all orcs in their assigned roles.

Write a program to determine the maximum possible strength of the newly formed squad.

Input

The first line contains three integers , , (1 \le n \le 10000,\ 0 \le g,\ h \le n). Each of the following lines contains two integers between and — the close combat ability (for grunt) and the javelin throwing ability (for headhunter) of the corresponding orc.

Output

Output the maximum possible strength the squad can achieve. If it is impossible to form a squad satisfying the given conditions, output .

Examples

Example

Input
3 2 1
3 4
8 2
2 9
Output
21

Example

Input
3 2 2
3 4
8 2
2 9
Output
19

Example

Input
2 3 1
1 3
2 2
Output
-1

Example 3

Loading
Loading

Example 2

Loading
Loading

Example 1

Loading
Loading