#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7, MAXN = 2e5 + 5;
int T, N, M, K, Q, A[MAXN], B[MAXN];
string S;
int gcd(int a, int b) { return !b ? a : gcd(b, a % b); }
void fillA() {
  for (int i = 0; i < N; ++i) cin >> A[i];
}
long long fast_pow(long long b, long long e) {
  long long ans = 1;
  while (e > 0) {
    if (e & 1) ans = (ans * b) % MOD;
    e >>= 1;
    b = (b * b) % MOD;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  int n, m, ta, tb, k;
  cin >> n >> m >> ta >> tb >> k;
  long long fa[n], fb[m];
  for (int i = 0; i < n; ++i) cin >> fa[i];
  for (int i = 0; i < m; ++i) cin >> fb[i];
  if (k >= n or k >= m) {
    cout << -1;
    return 0;
  }
  long long mm = LLONG_MIN;
  for (int i = n - 1; i > -1; --i) {
    int c = i;
    if (c > k) continue;
    auto l = lower_bound(fb, fb + m, fa[i] + ta);
    if (l == fb + m or l - fb + k - c >= m) {
      cout << -1;
      return 0;
    }
    mm = max(mm, fb[l - fb + k - c] + tb);
  }
  cout << mm;
  return 0;
}
