#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];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  long long b[m];
  for (int i = 0; i < m; ++i) {
    cin >> b[i];
  }
  long long max = 0;
  if (k >= n) {
    cout << -1 << endl;
    exit(0);
  }
  for (int i = 0; i <= k; ++i) {
    long long h = a[i] + ta;
    long long l = -1, r = m;
    while (r - l > 1) {
      long long mid = (l + r) / 2;
      if (b[mid] >= h) {
        r = mid;
      } else {
        l = mid;
      }
    }
    r += k - i;
    if (r >= m) {
      max = (1LL << 61);
    } else {
      max = std::max(max, b[r] + tb);
    }
  }
  if (max == (1LL << 61)) {
    cout << -1 << endl;
  } else {
    cout << max << endl;
  }
}
