#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, unsigned long long y, long long int p) {
  long long int res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y / 2;
    x = (x * x) % p;
  }
  return res;
}
int fib(int n) {
  double phi = (1 + sqrt(5)) / 2;
  return round(pow(phi, n) / sqrt(5));
}
long long int max_subarray_sum(vector<long long int> arr) {
  long long int max_till = -10000000000000;
  long long int val = 0;
  for (int i = 0; i < arr.size(); i++) {
    val += arr[i];
    max_till = max(max_till, val);
    if (val < 0) val = 0;
  }
  return max_till;
}
void print_vec(vector<long long int> arr) {
  for (int i = 0; i < arr.size(); i++) cout << arr[i] << " ";
  cout << endl;
}
void solve() {
  long long int f = 1;
  long long int n, m, a, b, k;
  cin >> n >> m >> a >> b >> k;
  vector<long long int> arr(n);
  vector<long long int> brr(m);
  for (auto &x : arr) cin >> x;
  for (auto &x : brr) cin >> x;
  if (k >= n)
    cout << -1 << "\n";
  else {
    vector<long long int> ans;
    for (int i = 0; i <= k; i++) {
      long long int ta = arr[i];
      long long int r_b = ta + a;
      if (brr[m - 1] < r_b) {
        f = 0;
        break;
      }
      long long int x = lower_bound(brr.begin(), brr.end(), r_b) - brr.begin();
      if (m - x <= k - i) f = 0;
      long long int xx = min(x + k - i, m - 1);
      ans.push_back(brr[xx] + b);
    }
    if (f == 0)
      cout << -1 << "\n";
    else
      cout << *max_element(ans.begin(), ans.end()) << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  t = 1;
  for (int _ = 0; _ < t; _++) {
    solve();
  }
}
