#include using namespace std; #define int long long #define all(x) x.begin(), x.end() #define app push_back #ifdef LOCAL #define debug(...) [](auto...a){ ((cout << a << ' '), ...) << '\n';}(#__VA_ARGS__, ":", __VA_ARGS__) #else #define debug(...) #endif int32_t main() { ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); int t=1; while(t--) { int n,x,y;cin>>n>>x>>y; int c[n];char d[n]; for(int i=0;i>c[i]>>d[i];} pair u[x+y]={}; for(int i=0;i a1,pair b1) {return a1.first-a1.second>b1.first-b1.second;}); for(int i=0;i