rt.
#include<bits/stdc++.h>
#define int long long
using namespace std;
long long read(){
long long x=0,f=1;
char ch=getchar();
while(ch<'0'||ch>'9'){
if(ch=='-'){
f=-1;
}
ch=getchar();
}
while(ch>='0'&&ch<='9'){
x=(x<<1)+(x<<3)+(ch^48);
ch=getchar();
}
return x*f;
}
void write(long long x){
if(x<0){
putchar('-');
x=-x;
}
if(x>9){
write(x/10);
}
putchar(x%10+'0');
}
int s[100005],w[100005];
priority_queue<tuple<int,int,int>,vector<tuple<int,int,int>>> q;
vector<tuple<int,int,int>> b;
signed main(){
int n=read(),r=read(),Q=read();
for(int i=1;i<=2*n;i++){
s[i]=read();
}
for(int i=1;i<=2*n;i++){
w[i]=read();
}
for(int i=1;i<=2*n;i++){
q.push(make_tuple(s[i],2*n-i+1,w[i]));
}
for(int i=1;i<=r;i++){
for(int j=1;j<=n;j++){
auto u=q.top();
q.pop();
auto v=q.top();
q.pop();
if(get<2>(u)>get<2>(v)){
int aa=get<0>(u)+1,bb=get<1>(u),cc=get<2>(u);
b.push_back(make_tuple(aa,bb,cc));
b.push_back(v);
}
else{
int aa=get<0>(v)+1,bb=get<1>(v),cc=get<2>(v);
b.push_back(make_tuple(aa,bb,cc));
b.push_back(u);
}
}
for(auto v:b){
q.push(v);
}
b.clear();
}
for(int i=1;i<Q;i++){
q.pop();
}
auto c=q.top();
write(2*n-get<1>(c)+1);
return 0;
}