#include <bits/stdc++.h>
using namespace std;
vector<vector<long long>> adj;
map<long, bool> vis, viss;
vector<long long> rnk, parent, sz;
int spf[1000000 + 1];
long long binpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(nullptr);
  long long t, temp;
  long long n, m, a, b, k;
  cin >> n >> m >> a >> b >> k;
  vector<long long> v, vv;
  for (long long i = 0; i < n; i++) {
    cin >> temp;
    v.push_back(temp);
  }
  for (long long i = 0; i < m; i++) {
    cin >> temp;
    vv.push_back(temp);
  }
  long long time = -1;
  if (k >= n || k >= m) {
    cout << -1 << "\n";
    return 0;
  }
  for (long long i = 0; i <= k; i++) {
    long long yg = lower_bound(vv.begin(), vv.end(), v[i] + a) - vv.begin();
    yg = yg + (k - i);
    if (yg >= vv.size()) {
      time = -1;
      break;
    }
    time = max(time, vv[yg] + b);
  }
  cout << time << "\n";
  return 0;
}
