#include <bits/stdc++.h>
using namespace std;
long long n, m, T, k, d;
const long long big = 1000000007;
long long s;
vector<vector<long long> > C(1501, vector<long long>());
vector<long long> A;
vector<long long> A2;
set<long long> S;
bool mark[1501] = {0};
vector<pair<long long, long long> > segs;
vector<int> inds;
long long GO[1501] = {0};
long long CS[1502] = {0};
long long DP[1501][1501] = {0};
long long DPC[1501][1501] = {0};
long long glob = 0;
long long dp(long long i, long long kvar) {
  if (kvar <= 0) return 0;
  if (i >= n) return 0;
  if (DPC[i][kvar] == glob) return DP[i][kvar];
  long long extra = 0;
  if (GO[i] != i) {
    extra = CS[GO[i]] - CS[i] + dp(GO[i], kvar - 1);
  }
  long long ans = max(dp(i + 1, kvar), extra);
  DPC[i][kvar] = glob;
  DP[i][kvar] = ans;
  return ans;
}
bool test(long long i) {
  glob++;
  CS[0] = 0;
  for (int c1 = 0; c1 < n; c1++) {
    CS[c1 + 1] = CS[c1] + (A[c1] <= i);
  }
  long long f = 0;
  for (int c1 = 0; c1 < (int)(inds).size(); c1++) {
    if (dp(c1, m) >= k) return 1;
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long a, b, c, e;
  cin >> n >> s >> m >> k;
  for (int c1 = 0; c1 < n; c1++) {
    GO[c1] = c1;
  }
  for (int c1 = 0; c1 < n; c1++) {
    cin >> a;
    A.push_back(a);
    if (S.find(a) == S.end()) A2.push_back(a);
    S.insert(a);
  }
  long long sumc = 0;
  for (int c1 = 0; c1 < s; c1++) {
    cin >> a >> b;
    a--;
    b--;
    segs.push_back({a, b});
    for (int c2 = a; c2 <= b; c2++) {
      GO[c2] = max(GO[c2], b + 1);
      C[c1].push_back(c2);
      if (!mark[c2]) {
        inds.push_back(c2);
      }
      mark[c2] = 1;
    }
    sort(C[c1].begin(), C[c1].end());
    sumc += (int)(C[c1]).size();
  }
  sort(A2.begin(), A2.end());
  long long tot = 0;
  for (int c1 = 0; c1 < n; c1++) {
    if (mark[c1]) tot++;
  }
  long long l = 0;
  long long r = (int)(A2).size() - 1;
  if (!test(A2[(int)(A2).size() - 1])) {
    cout << "-1\n";
    return 0;
  }
  if (test(A2[l])) {
    cout << A2[l] << "\n";
    return 0;
  }
  while (l < r - 1) {
    long long mid = (l + r) / 2;
    if (test(A2[mid])) {
      r = mid;
    } else {
      l = mid;
    }
  }
  cout << A2[r] << "\n";
  return 0;
}
