#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ll n, m, ta, tb, k;
  cin >> n >> m >> ta >> tb >> k;
  vector<ll> a(n), b(m);
  for (ll i = 0; i < n; ++i) cin >> a[i], a[i] += ta + tb;
  for (ll i = 0; i < m; ++i) cin >> b[i], b[i] += tb;
  sort(begin(a), end(a));
  sort(begin(b), end(b));
  ll idxa = 0, idxb = 0;
  if (k >= min(n, m)) {
    cout << -1;
    return 0;
  }
  ll ans = 0;
  while (idxa < min(n, k + 1)) {
    auto itb = lower_bound(begin(b), end(b), a[idxa]);
    if (itb == end(b)) {
      cout << -1;
      return 0;
    }
    idxb = itb - begin(b);
    if (m - idxb <= k - idxa) {
      cout << -1;
      return 0;
    }
    ans = max(ans, b[idxb + k - idxa]);
    ++idxa;
  }
  cout << ans;
  return 0;
}
