#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
int main() {
  ios::sync_with_stdio(0);
  ll n, m, ta, tb, k;
  cin >> n >> m >> ta >> tb >> k;
  vector<ll> v1(n);
  vector<ll> v2(m);
  for (int i = 0; i < n; i++) {
    cin >> v1[i];
    v1[i] += ta;
  }
  for (int i = 0; i < m; i++) cin >> v2[i];
  if (k >= n) {
    cout << -1 << endl;
    return 0;
  }
  ll ans = -1;
  for (int i = 0; i <= k; i++) {
    ll t1 = v1[i];
    ll rest = k - i;
    auto it = lower_bound(v2.begin(), v2.end(), t1);
    it += rest;
    if (it >= v2.end()) {
      cout << -1 << endl;
      return 0;
    } else {
      ans = max(ans, *it);
    }
  }
  cout << ans + tb << endl;
}
