#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m, a, b, k;
  cin >> n >> m >> a >> b >> k;
  vector<long long> v1(n, 0);
  vector<long long> v2(m, 0);
  vector<long long> v3(n, 0);
  for (long long i = 0; i < n; i++) {
    cin >> v1[i];
    v1[i] += a;
  }
  for (long long i = 0; i < m; i++) {
    cin >> v2[i];
  }
  long long ptr = 0;
  for (long long i = 0; i < n; i++) {
    while (ptr != m && v2[ptr] < v1[i]) {
      ptr++;
    }
    if (ptr == m) {
      v3[i] = -1;
    } else {
      v3[i] = ptr;
    }
  }
  if (n <= k || m <= k) {
    cout << -1;
    return 0;
  }
  long long ans = -1;
  for (long long i = 0; i < n; i++) {
    if (k < 0) {
      break;
    }
    if (v3[i] == -1 || (v3[i] + k) >= m) {
      cout << -1;
      return 0;
    }
    ans = max(ans, b + v2[v3[i] + k]);
    k--;
  }
  cout << ans << endl;
  return 0;
}
