#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

typedef pair<int,int> pint;

int main(){
    int n,m,h,k,s;
    while(cin>>n>>m>>h>>k,n){
        vector<pint> pl,hl,chg;
        for(int i=1;i<=n;++i){
            cin>>s;
            pl.push_back(make_pair(i,s));
        }
        int t1,t2;
        for(int i=0;i<m;++i){
            cin>>t1>>t2;
            hl.push_back(make_pair(t2,t1));
        }
        sort(hl.begin(),hl.end());
        for(vector<pint>::iterator it=hl.begin();it!=hl.end();++it){
            swap(pl[it->second].first,pl[it->second-1].first);
            t1=pl[it->second].first;
            t2=pl[it->second-1].first;
            if((t1-k-0.5)*(t2-k-0.5)<0) chg.push_back(make_pair(t1,t2));
        }
        int sum=0,score[1001];
        for(vector<pint>::iterator it=pl.begin();it!=pl.end();++it){
            if(it->first<=k) sum += it->second;
            score[it->first-1] = it->second;
        }
        int ans=sum;
        for(vector<pint>::iterator it=chg.begin();it!=chg.end();++it){
            t1=score[it->first-1]-score[it->second-1];
            if(it->first>k) ans = min(ans,sum+t1);
            else ans = min(ans,sum-t1);
        }
        cout<<ans<<endl;
    }
    return 0;
}