#include<bits/stdc++.h>
#define t second
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef pair<int, int>P;

int s[1000], d[1000], y[1000], a, b, n, m, h, k;
P p[100000];
int main() {
	while (scanf("%d%d%d%d", &n, &m, &h, &k), n) {
		rep(i, n)scanf("%d", &s[i]);
		rep(i, m)scanf("%d%d", &a, &b), p[i] = { b,a };
		sort(p, p + m); iota(d, d + n, 0);
		rep(i, m) {
			swap(d[p[i].t - 1], d[p[i].t]);
			p[i] = { d[p[i].t - 1],d[p[i].t] };
			if (p[i].first > p[i].t)swap(p[i].first, p[i].t);
		}
		rep(i, n)y[d[i]] = s[i];
		int M = accumulate(y, y + k, 0); int S = M;
		rep(i, m)if (p[i].first < k&&p[i].second >= k)M = min(M, S + y[p[i].second] - y[p[i].first]);
		printf("%d\n", M);
	}
}