#include <bits/stdc++.h>
using namespace std;
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}' << "\n";
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}"
       << "\n";
}
template <typename T, typename... Args>
void __print(T t, Args... args) {
  cout << t << " ";
  __print(args...);
}
void nl() { cout << "\n"; }
using ll = long long int;
using ld = long double;
using pll = pair<ll, ll>;
using pii = pair<int, int>;
using plll = pair<ll, pll>;
using vll = vector<ll>;
using vi = vector<int>;
const ll MOD = (ll)(1e9) + 7LL;
const ll MM = 998244353LL;
const ll INF = INT_MAX;
const int dir8[8][2] = {{1, 0}, {0, 1},  {-1, 0}, {0, -1},
                        {1, 1}, {1, -1}, {-1, 1}, {-1, -1}};
const int dir4[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
const ll MAXN = 200005;
void solve() {
  ll n, m, ta, tb, k;
  cin >> n >> m >> ta >> tb >> k;
  vector<ll> arr(n);
  vector<ll> brr(m);
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 0; i < m; i++) cin >> brr[i];
  if (k >= n) {
    cout << -1 << "\n";
    return;
  }
  sort((arr).begin(), (arr).end());
  sort((brr).begin(), (brr).end());
  ll ans = 0;
  for (int i = 0; i <= k; i++) {
    ll left = k - i;
    ll curr = arr[i];
    curr += ta;
    ll nxt = lower_bound((brr).begin(), (brr).end(), curr) - brr.begin();
    if (nxt + left >= m) {
      cout << -1 << "\n";
      return;
    }
    ans = max(ans, brr[nxt + left] + tb);
  }
  cout << ans << "\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(NULL);
  cin.tie(NULL);
  ;
  ll tc = 1;
  while (tc--) {
    solve();
  }
  return 0;
}
