#include <bits/stdc++.h>
using namespace std;
void write(vector<long long> &oneD) {
  for (long long i = 0; i < oneD.size(); i++) {
    printf("%lld ", oneD[i]);
  }
  printf("\n");
}
void write(vector<vector<long long> > &twoD) {
  for (long long i = 0; i < twoD.size(); i++) {
    write(twoD[i]);
  }
}
void write(vector<pair<long long, long long> > &oneDP) {
  for (long long(i) = 0; (i) < (oneDP.size()); ++(i)) {
    printf("%lld %lld\n", oneDP[i].first, oneDP[i].second);
  }
  cout << "\n";
}
void write(map<long long, long long> &mpp) {
  for (map<long long, long long>::iterator it = mpp.begin(); it != mpp.end();
       it++) {
    cout << it->first << " : " << it->second << '\n';
  }
  cout << '\n';
}
bool cmp(const pair<long long, long long> &a,
         const pair<long long, long long> &b) {
  if (a.first == b.first) return (a.second >= b.second);
  return (a.first < b.first);
}
vector<long long> seive;
vector<long long> primes;
void Seive() {
  const long long maxn = 100005;
  seive.resize(maxn);
  for (long long(i) = 0; (i) < (maxn); ++(i)) seive[i] = 1;
  for (long long i = 2; i * i < maxn; i++) {
    if (seive[i] == 1) {
      for (long long j = i * i; j < maxn; j += i) {
        seive[j] = 0;
      }
    }
  }
  primes.push_back(2);
  for (long long i = 3; i < maxn; i += 2) {
    if (seive[i]) primes.push_back(i);
  }
}
long long isprime(long long N) {
  if (N < 2 || (!(N & 1) && N != 2)) return 0;
  for (long long i = 3; i * i <= N; i += 2) {
    if (!(N % i)) return 0;
  }
  return 1;
}
long long power(long long x, long long y, long long m) {
  long long int res = 1;
  x = x % m;
  while (y > 0) {
    if (y & 1) res = (res * x) % 1000000007;
    y = y >> 1;
    x = (x * x) % 1000000007;
  }
  return res;
}
long long modinv(long long x, long long mod = 1000000007) {
  return power(x, mod - 2, mod);
}
long long A[1000005];
long long B[200005];
long long C[100001];
long long D[100001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long a, b, c, d;
  long long k, l, m, n, p, q, r, t, x, y;
  cin >> n >> m >> a >> b >> k;
  for (long long(i) = 0; (i) < (n); ++(i)) {
    cin >> A[i];
  }
  for (long long(i) = 0; (i) < (m); ++(i)) {
    cin >> B[i];
  }
  long long ans = -1;
  long long mid;
  long long j;
  bool f = 0;
  if (n <= k) {
    cout << "-1\n";
    return 0;
  }
  for (long long(i) = 0; (i) < (k + 1); ++(i)) {
    j = lower_bound(B, B + m, A[i] + a) - B;
    j += (k - i);
    if (j >= m) {
      f = 1;
      break;
    }
    ans = max(ans, B[j] + b);
  }
  if (f)
    cout << "-1\n";
  else
    cout << ans << '\n';
}
