#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n, m, ta, tb, k;
  cin >> n >> m >> ta >> tb >> k;
  vector<long long> A(n);
  for (auto &v : A) {
    cin >> v;
    v += ta;
  }
  vector<long long> B(m);
  for (auto &v : B) cin >> v;
  long long j = 0, ans = -1;
  if (k >= n) {
    cout << "-1";
    return 0;
  }
  for (long long i = 0; i <= k; i++) {
    while (j < m && B[j] < A[i]) j++;
    if (j == m) {
      cout << "-1";
      return 0;
    }
    long long left = k - i;
    long long idx = j + left;
    if (idx >= m) {
      cout << "-1";
      return 0;
    }
    if (ans == -1)
      ans = B[idx] + tb;
    else
      ans = max(ans, B[idx] + tb);
  }
  cout << ans;
}
