#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c *x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct deb {
  template <class c>
  deb &operator<<(const c &) {
    return *this;
  }
};
const long long mod = 1e9 + 7;
inline long long add(long long a, long long b) {
  return ((a % mod) + (b % mod)) % mod;
}
inline long long sub(long long a, long long b) {
  return ((a % mod) - (b % mod) + mod) % mod;
}
inline long long mul(long long a, long long b) {
  return ((a % mod) * (b % mod)) % mod;
}
const long long inf = 1e18;
const long long maxn = 1e3 + 5;
void err(istream_iterator<string> it) { return; }
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << "\n";
  err(++it, args...);
}
void solve() {
  long long n, m, ta, tb, k;
  cin >> n >> m >> ta >> tb >> k;
  vector<long long> sa(n);
  vector<long long> sb(m);
  for (long long i = 0; i < sa.size(); i++) cin >> sa[i];
  ;
  vector<long long> ea(n);
  for (long long i = 0; i < n; i++) {
    ea[i] = sa[i] + ta;
  }
  for (long long i = 0; i < sb.size(); i++) cin >> sb[i];
  ;
  if (k >= n) {
    cout << -1 << "\n";
    return;
  }
  long long i = 0;
  long long j = 0;
  while (j < m && sb[j] < ea[i]) {
    j++;
  }
  if (j == m) {
    cout << -1 << '\n';
    return;
  }
  long long mxrange = 0;
  i = -1;
  long long K = k;
  while (k + 1) {
    long long range1 = 0;
    long long range2 = 0;
    long long idx = 0;
    assert(i + 1 <= n - 1);
    if (i + 1 < n) {
      idx = lower_bound(sb.begin() + j, sb.end(), ea[i + 1]) - sb.begin();
      if (idx + K - (i + 1) < m) {
        range1 = max(mxrange, sb[idx + K - (i + 1)] + tb);
        mxrange = max(mxrange, range1);
      } else {
        cout << -1 << "\n";
        return;
      }
    }
    ++i;
    --k;
  }
  cout << mxrange << "\n";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  for (long long tt = 1; tt <= t; tt++) {
    solve();
  }
}

### Prompt

Develop a solution in CPP to the problem described below:

Arkady bought an air ticket from a city A to a city C. Unfortunately, there are no direct flights, but there are a lot of flights from A to a city B, and from B to C.

There are n flights from A to B, they depart at time moments a_1, a_2, a_3, ..., a_n and arrive at B t_a moments later.

There are m flights from B to C, they depart at time moments b_1, b_2, b_3, ..., b_m and arrive at C t_b moments later.

The connection time is negligible, so one can use the i-th flight from A to B and the j-th flight from B to C if and only if b_j ≥ a_i + t_a.

You can cancel at most k flights. If you cancel a flight, Arkady can not use it.

Arkady wants to be in C as early as possible, while you want him to be in C as late as possible. Find the earliest time Arkady can arrive at C, if you optimally cancel k flights. If you can cancel k or less flights in such a way that it is not possible to reach C at all, print -1.

Input

The first line contains five integers n, m, t_a, t_b and k (1 ≤ n, m ≤ 2 ⋅ 10^5, 1 ≤ k ≤ n + m, 1 ≤ t_a, t_b ≤ 10^9) — the number of flights from A to B, the number of flights from B to C, the flight time from A to B, the flight time from B to C and the number of flights you can cancel, respectively.

The second line contains n distinct integers in increasing order a_1, a_2, a_3, ..., a_n (1 ≤ a_1 < a_2 < … < a_n ≤ 10^9) — the times the flights from A to B depart.

The third line contains m distinct integers in increasing order b_1, b_2, b_3, ..., b_m (1 ≤ b_1 < b_2 < … < b_m ≤ 10^9) — the times the flights from B to C depart.

Output

If you can cancel k or less flights in such a way that it is not possible to reach C at all, print -1.

Otherwise print the earliest time Arkady can arrive at C if you cancel k flights in such a way that maximizes this time.

Examples

Input


4 5 1 1 2
1 3 5 7
1 2 3 9 10


Output


11


Input


2 2 4 4 2
1 10
10 20


Output


-1


Input


4 3 2 3 1
1 999999998 999999999 1000000000
3 4 1000000000


Output


1000000003

Note

Consider the first example. The flights from A to B depart at time moments 1, 3, 5, and 7 and arrive at B at time moments 2, 4, 6, 8, respectively. The flights from B to C depart at time moments 1, 2, 3, 9, and 10 and arrive at C at time moments 2, 3, 4, 10, 11, respectively. You can cancel at most two flights. The optimal solution is to cancel the first flight from A to B and the fourth flight from B to C. This way Arkady has to take the second flight from A to B, arrive at B at time moment 4, and take the last flight from B to C arriving at C at time moment 11.

In the second example you can simply cancel all flights from A to B and you're done.

In the third example you can cancel only one flight, and the optimal solution is to cancel the first flight from A to B. Note that there is still just enough time to catch the last flight from B to C.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c *x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct deb {
  template <class c>
  deb &operator<<(const c &) {
    return *this;
  }
};
const long long mod = 1e9 + 7;
inline long long add(long long a, long long b) {
  return ((a % mod) + (b % mod)) % mod;
}
inline long long sub(long long a, long long b) {
  return ((a % mod) - (b % mod) + mod) % mod;
}
inline long long mul(long long a, long long b) {
  return ((a % mod) * (b % mod)) % mod;
}
const long long inf = 1e18;
const long long maxn = 1e3 + 5;
void err(istream_iterator<string> it) { return; }
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << "\n";
  err(++it, args...);
}
void solve() {
  long long n, m, ta, tb, k;
  cin >> n >> m >> ta >> tb >> k;
  vector<long long> sa(n);
  vector<long long> sb(m);
  for (long long i = 0; i < sa.size(); i++) cin >> sa[i];
  ;
  vector<long long> ea(n);
  for (long long i = 0; i < n; i++) {
    ea[i] = sa[i] + ta;
  }
  for (long long i = 0; i < sb.size(); i++) cin >> sb[i];
  ;
  if (k >= n) {
    cout << -1 << "\n";
    return;
  }
  long long i = 0;
  long long j = 0;
  while (j < m && sb[j] < ea[i]) {
    j++;
  }
  if (j == m) {
    cout << -1 << '\n';
    return;
  }
  long long mxrange = 0;
  i = -1;
  long long K = k;
  while (k + 1) {
    long long range1 = 0;
    long long range2 = 0;
    long long idx = 0;
    assert(i + 1 <= n - 1);
    if (i + 1 < n) {
      idx = lower_bound(sb.begin() + j, sb.end(), ea[i + 1]) - sb.begin();
      if (idx + K - (i + 1) < m) {
        range1 = max(mxrange, sb[idx + K - (i + 1)] + tb);
        mxrange = max(mxrange, range1);
      } else {
        cout << -1 << "\n";
        return;
      }
    }
    ++i;
    --k;
  }
  cout << mxrange << "\n";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  for (long long tt = 1; tt <= t; tt++) {
    solve();
  }
}

```