#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, ta, tb, k;
  cin >> n >> m >> ta >> tb >> k;
  long long a[n], b[m];
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < m; i++) cin >> b[i];
  int index = 0;
  for (long long i = 0; i < m; i++) {
    if (index < n && a[index] + ta <= b[i]) {
      index++;
      k--;
      if (k == -1) {
        cout << b[i] + tb << "\n";
        return 0;
      }
    }
  }
  cout << "-1\n";
  return 0;
}
