#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int N = 600000;
int n, s, m, k;
int ar[N];
int L[N], R[N];
vector<int> ends_at[N];
int val[1531];
int S[1531];
int max_taken[1531][1531], min_missed[1531][1531];
int sparse_min[50][1531], sparse_max[50][1531];
int LG[1531];
int sparse_taken(int l, int r) {
  int span = r - l + 1;
  span = LG[span];
  return max(sparse_max[span][l], sparse_max[span][r - (1 << span) + 1]);
}
int sparse_missed(int l, int r) {
  int span = r - l + 1;
  span = LG[span];
  return min(sparse_min[span][l], sparse_min[span][r - (1 << span) + 1]);
}
void build_sparse(int lvl) {
  for (int i = 0; i <= n; i++) {
    sparse_max[0][i] = max_taken[lvl][i];
    sparse_min[0][i] = min_missed[lvl][i];
  }
  for (int lev = 1; lev <= 11; lev++) {
    for (int i = 0; i + (1 << lev) - 1 <= n; i++) {
      sparse_max[lev][i] =
          max(sparse_max[lev - 1][i], sparse_max[lev - 1][i + (1 << lev) / 2]);
      sparse_min[lev][i] =
          min(sparse_min[lev - 1][i], sparse_min[lev - 1][i + (1 << lev) / 2]);
    }
  }
}
int solve(int thold) {
  for (int i = 1; i <= n; i++) {
    if (ar[i] <= thold)
      val[i] = 1;
    else
      val[i] = 0;
  }
  for (int i = 1; i <= n; i++) {
    S[i] = S[i - 1] + val[i];
  }
  for (int i = 0; i <= m; i++) {
    for (int j = 0; j <= n; j++) {
      max_taken[i][j] = -1e9;
      min_missed[i][j] = 1e9;
    }
  }
  max_taken[0][0] = min_missed[0][0] = 0;
  int ret = 0;
  for (int lev = 1; lev <= m; lev++) {
    build_sparse(lev - 1);
    for (int i = 0; i <= n; i++) {
      max_taken[lev][i] = max_taken[lev - 1][i];
      min_missed[lev][i] = min_missed[lev - 1][i];
    }
    for (int i = 1; i <= n; i++) {
      for (int j = 0; j < ends_at[i].size(); j++) {
        int id = ends_at[i][j];
        int not_intersect = sparse_taken(0, L[id] - 1);
        int this_covers = S[R[id]] - S[L[id] - 1];
        max_taken[lev][i] = max(max_taken[lev][i], not_intersect + this_covers);
        min_missed[lev][i] = min(min_missed[lev][i], S[i] - max_taken[lev][i]);
        int does_intersect = sparse_missed(L[id], R[id]);
        min_missed[lev][i] = min(min_missed[lev][i], does_intersect);
        max_taken[lev][i] = max(max_taken[lev][i], S[i] - min_missed[lev][i]);
      }
    }
  }
  for (int i = 0; i <= n; i++) {
    ret = max(ret, max_taken[m][i]);
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  for (int i = 2; i <= 1500; i++) {
    LG[i] = LG[i / 2] + 1;
  }
  cin >> n >> s >> m >> k;
  for (int i = 1; i <= n; i++) {
    cin >> ar[i];
  }
  for (int i = 1; i <= s; i++) {
    cin >> L[i] >> R[i];
    ends_at[R[i]].push_back(i);
  }
  int l, r;
  l = 0;
  r = 1e9 + 1e6;
  while (l < r) {
    int mid = l + r;
    mid /= 2;
    int best = solve(mid);
    if (best >= k) {
      r = mid;
    } else {
      l = mid + 1;
    }
  }
  if (l > 1e9 + 1e5) l = -1;
  cout << l << endl;
  return 0;
}
