#include <bits/stdc++.h>
using namespace std;
int N, M;
int K;
vector<long long> A, B;
int TA, TB;
long long ans = 0;
int main() {
  cin >> N >> M >> TA >> TB >> K;
  for (int i = 0; i < N; i++) {
    long long x;
    scanf("%lld", &x);
    A.push_back(x + TA);
  }
  for (int i = 0; i < M; i++) {
    long long x;
    scanf("%lld", &x);
    B.push_back(x);
  }
  if (K >= N || K >= M) {
    printf("-1");
    return 0;
  }
  sort(A.begin(), A.end());
  sort(B.begin(), B.end());
  int idx2 = 0;
  for (int i = 0; i <= K; i++) {
    int j = K - i;
    long long t = A[i];
    while (idx2 < B.size() && B[idx2] < t) {
      idx2++;
    }
    if (idx2 + j >= B.size()) {
      ans = max(ans, 1000000000000000000LL);
    } else {
      ans = max(ans, B[idx2 + j] + TB);
    }
  }
  if (ans == 1000000000000000000LL) {
    printf("-1");
  } else {
    printf("%lld", ans);
  }
  return 0;
}
