#include <bits/stdc++.h>
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int_fast64_t n, m, ta, tb, k;
  std::cin >> n >> m >> ta >> tb >> k;
  if (n <= k || m <= k) {
    std::cout << -1 << std::endl;
    return 0;
  }
  std::vector<uint_fast64_t> as(n, 0), bs(m, 0);
  std::vector<std::pair<uint_fast64_t, uint_fast64_t>> events;
  for (uint_fast64_t i = 0; i < n; ++i) {
    std::cin >> as[i];
    events.emplace_back(as[i] + ta, 0);
  }
  for (uint_fast64_t i = 0; i < m; ++i) {
    std::cin >> bs[i];
    events.emplace_back(bs[i], 1);
  }
  std::sort(events.begin(), events.end());
  uint_fast64_t fags = 0, fbgs = 0, fai = 0, fbi = 0;
  uint_fast64_t b_canc = 0;
  uint_fast64_t i = 0;
  while (events[i].second == 1) ++i;
  for (; i < events.size(); ++i) {
    if (events[i].second == 0) {
      if (fbgs == 0)
        ++fags;
      else {
        if (fags <= b_canc) {
          fags = 0;
          fbgs = 0;
          k += b_canc - fags;
          continue;
        }
        fags -= b_canc;
        if (k < std::min(fags, fbgs)) {
          std::cout << events[fbi + k].first + tb << std::endl;
          return 0;
        } else if (fbgs < fags) {
          k -= fbgs;
          fags += b_canc;
          b_canc += fbgs;
          fbgs = 0;
          ++fags;
        } else {
          k -= fags;
          fbgs = 0;
          fags = 1;
          b_canc = 0;
        }
      }
    } else {
      if (fbgs == 0) fbi = i;
      ++fbgs;
    }
  }
  if (k < std::min(fags, fbgs)) {
    std::cout << events[fbi + k].first + tb << std::endl;
  } else {
    std::cout << -1 << std::endl;
  }
  return 0;
}
