Finally! Vasya have come of age and that means he can finally get a passport! To do it, he needs to visit the passport office, but it's not that simple. There's only one receptionist at the passport office and people can queue up long before it actually opens. Vasya wants to visit the passport office tomorrow.
He knows that the receptionist starts working after _t__s_ minutes have passed after midnight and closes after _t__f_ minutes have passed after midnight (so that (_t__f_ - 1) is the last minute when the receptionist is still working). The receptionist spends exactly _t_ minutes on each person in the queue. If the receptionist would stop working within _t_ minutes, he stops serving visitors (other than the one he already serves).
Vasya also knows that exactly _n_ visitors would come tomorrow. For each visitor Vasya knows the point of time when he would come to the passport office. Each visitor queues up and doesn't leave until he was served. If the receptionist is free when a visitor comes (in particular, if the previous visitor was just served and the queue is empty), the receptionist begins to serve the newcomer immediately.
<center> "Reception 1"</center>For each visitor, the point of time when he would come to the passport office is positive. Vasya can come to the office at the time zero (that is, at midnight) if he needs so, but he can come to the office only at integer points of time. If Vasya arrives at the passport office at the same time with several other visitors, he yields to them and stand in the queue after the last of them.
Vasya wants to come at such point of time that he will be served by the receptionist, and he would spend the minimum possible time in the queue. Help him!
## Input
The first line contains three integers: the point of time when the receptionist begins to work _t__s_, the point of time when the receptionist stops working _t__f_ and the time the receptionist spends on each visitor _t_. The second line contains one integer _n_ — the amount of visitors (0 ≤ _n_ ≤ 100 000). The third line contains positive integers in non-decreasing order — the points of time when the visitors arrive to the passport office.
All times are set in minutes and do not exceed 1012; it is guaranteed that _t__s_ < _t__f_. It is also guaranteed that Vasya can arrive at the passport office at such a point of time that he would be served by the receptionist.
## Output
Print single non-negative integer — the point of time when Vasya should arrive at the passport office. If Vasya arrives at the passport office at the same time with several other visitors, he yields to them and queues up the last. If there are many answers, you can print any of them.
[samples]
## Note
In the first example the first visitor comes exactly at the point of time when the receptionist begins to work, and he is served for two minutes. At 12 minutes after the midnight the receptionist stops serving the first visitor, and if Vasya arrives at this moment, he will be served immediately, because the next visitor would only come at 13 minutes after midnight.
In the second example, Vasya has to come before anyone else to be served.
Let $ t_s $, $ t_f $, and $ t $ be given integers: the start time, end time, and service duration, respectively.
Let $ n $ be the number of pre-scheduled visitors.
Let $ a_1 \leq a_2 \leq \dots \leq a_n $ be the arrival times of the visitors (positive integers, in non-decreasing order).
Define the service completion time for each visitor recursively:
- Let $ s_0 = t_s $ (the time the receptionist becomes available).
- For each visitor $ i = 1, 2, \dots, n $:
$$
s_i = \max(s_{i-1}, a_i) + t
$$
(the receptionist starts serving visitor $ i $ at $ \max(s_{i-1}, a_i) $, and finishes at $ s_i $).
Vasya can arrive at any integer time $ x \geq 0 $.
He will be served if and only if there exists a time $ x $ such that:
- $ x \leq t_f - t $ (so that service can start by $ t_f - t $ at latest),
- and the receptionist is free at time $ x $, i.e., $ x \geq s_{i} $ for the last visitor $ i $ who finished before $ x $, and $ x + t \leq t_f $.
Vasya arrives **after** all other visitors arriving at the same time.
We seek the **earliest possible** arrival time $ x \in \mathbb{Z}_{\geq 0} $ such that:
- $ x + t \leq t_f $,
- and $ x \geq \max(s_{i}, a_{i+1}) $ for some $ i $, meaning he arrives **immediately after** the $ i $-th visitor finishes **and before** the $ (i+1) $-th visitor arrives (or there is no next visitor).
The possible candidate times for Vasya’s arrival are:
1. $ x = t_s $ — if $ t_s \leq t_f - t $, and no visitor arrives before $ t_s $, or the last visitor before $ t_s $ finishes by $ t_s $.
2. Between visitors: for each $ i = 0, 1, \dots, n $, consider the interval $ [s_i, a_{i+1}) $, where $ a_0 = -\infty $, $ a_{n+1} = \infty $, and $ s_0 = t_s $.
The earliest available slot in this interval is $ \max(s_i, t_s) $, but since $ s_i \geq t_s $, we take $ x = s_i $, provided $ s_i + t \leq t_f $ and $ s_i < a_{i+1} $ (if $ i < n $).
3. After all visitors: $ x = s_n $, if $ s_n + t \leq t_f $.
We must choose the **smallest** such $ x \geq 0 $ satisfying:
- $ x \in \mathbb{Z} $,
- $ x \geq t_s $ (since receptionist starts at $ t_s $),
- $ x + t \leq t_f $,
- $ x \geq s_i $ for some $ i \in \{0, 1, \dots, n\} $,
- and $ x < a_{i+1} $ if $ i < n $, or no constraint if $ i = n $.
Thus, the candidate set is:
$$
\mathcal{C} = \left\{ s_i \;\middle|\; 0 \leq i \leq n,\; s_i + t \leq t_f,\; \text{and}\; (i = n \text{ or } s_i < a_{i+1}) \right\}
$$
where $ s_0 = t_s $, and $ s_i = \max(s_{i-1}, a_i) + t $ for $ i \geq 1 $.
Then, the answer is:
$$
\boxed{\min \mathcal{C}}
$$
(Note: Since $ s_i $ are computed in increasing order, and $ s_i \geq t_s $, the first valid $ s_i $ in the sequence that satisfies $ s_i + t \leq t_f $ and $ s_i < a_{i+1} $ (or $ i = n $) is the optimal answer.)