#include <bits/stdc++.h>
using namespace std;
long long n, m, ta, tb, k;
long long a[200010], b[200010];
long long sum[2][500010];
long long K;
vector<pair<long long, long long> > vs;
bool ok(long long X) {
  long long idx = K;
  for (long long i = (long long)(0); i < (long long)(K); i++) {
    if (vs[i].first >= X && vs[i].second == 1) {
      idx = i;
      break;
    }
  }
  long long res = 1e16;
  for (long long i = (long long)(0); i < (long long)(idx + 1); i++) {
    res = (res < (sum[0][i]) + (sum[1][idx] - sum[1][i])
               ? res
               : (sum[0][i]) + (sum[1][idx] - sum[1][i]));
  }
  return res <= k;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> m >> ta >> tb >> k;
  for (long long i = (long long)(0); i < (long long)(n); i++) {
    cin >> a[i];
    a[i] += ta;
    vs.push_back(pair<long long, long long>(a[i], 0));
  }
  for (long long i = (long long)(0); i < (long long)(m); i++) {
    cin >> b[i];
    vs.push_back(pair<long long, long long>(b[i], 1));
  }
  sort((vs).begin(), (vs).end());
  K = vs.size();
  for (long long i = (long long)(0); i < (long long)(K); i++)
    for (long long j = (long long)(0); j < (long long)(2); j++) {
      if (j == vs[i].second)
        sum[j][i + 1] = sum[j][i] + 1;
      else
        sum[j][i + 1] = sum[j][i];
    }
  long long lb = 1, ub = 1e11 + 1;
  while (ub - lb > 1) {
    long long mid = (lb + ub) / 2;
    if (ok(mid))
      lb = mid;
    else
      ub = mid;
  }
  if (lb == 1e11)
    cout << -1 << endl;
  else
    cout << lb + tb << endl;
  return 0;
}
