#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, x, y, k;
  cin >> n >> m >> x >> y >> k;
  vector<long long int> a(n);
  vector<long long int> b(m);
  for (long long int i = 0; i < n; i++) cin >> a[i];
  for (long long int i = 0; i < m; i++) cin >> b[i];
  if (k >= n || k >= m) {
    cout << -1 << endl;
    return 0;
  }
  long long int ans = INT_MIN;
  for (long long int i = 0; i <= k; i++) {
    if (lower_bound(b.begin(), b.end(), a[i] + x) == b.end()) {
      cout << -1 << endl;
      return 0;
    }
    if ((b.size() - (lower_bound(b.begin(), b.end(), a[i] + x) - b.begin())) <=
        (k - i)) {
      cout << -1 << endl;
      return 0;
    }
    ans = max(
        ans,
        b[lower_bound(b.begin(), b.end(), a[i] + x) - b.begin() + k - i] + y);
  }
  cout << ans << endl;
}
