#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, m, ta, tb, k, p, ans;
int ba[N], bb[N];
int ea[N];
int main() {
  scanf("%d%d%d%d%d", &n, &m, &ta, &tb, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", ba + i);
    ea[i] = ba[i] + ta;
  }
  for (int i = 0; i < m; i++) scanf("%d", bb + i);
  if (k >= n || k >= m) {
    puts("-1");
    return 0;
  }
  for (int i = 0; i <= k; i++)
    if (ea[i] > bb[m - 1 - (k - i)]) {
      puts("-1");
      return 0;
    }
  p = m - 1;
  while (p != -1 && bb[p] >= ea[k]) p--;
  ans = bb[p + 1] + tb;
  for (int i = k - 1; i >= 0; i--) {
    while (p != -1 && bb[p] >= ea[i]) p--;
    ans = max(ans, bb[p + 1 + k - i] + tb);
  }
  printf("%d\n", ans);
  return 0;
}
