#include <bits/stdc++.h>
bool debug = 1;
const long long MOD = 1000000007;
const double PI = acos(-1.0);
const double eps = 1e-9;
using namespace std;
long long a[200100], b[200100];
long long ta, tb;
int n, m, k;
void fail() {
  printf("-1\n");
  exit(0);
}
int main() {
  scanf("%d %d", &n, &m);
  scanf("%lld %lld", &ta, &tb);
  scanf("%d", &k);
  for (int i = (0); i < (n); i++) scanf("%lld", &a[i]);
  for (int i = (0); i < (m); i++) scanf("%lld", &b[i]);
  int resto = k, i = 0;
  long long res = -1LL;
  while (resto >= 0) {
    if (i >= n) fail();
    int v = lower_bound(b, b + m, a[i] + ta) - b;
    if (v + resto >= m) fail();
    res = max(res, (long long)b[v + resto] + (long long)tb);
    resto--;
    i++;
  }
  printf("%lld\n", res);
  return 0;
}
