An air conditioner is a device that allows you to maintain an optimal climate in rooms. One of its main functions is to lower the air temperature when it is hot and raise it when it is cold. Thus, the air conditioner sets a particular temperature in the room.
Recently, a Bindbrooms air conditioner was installed in the school principal's office. The device operates within a temperature range from to inclusive. The remote control has two buttons, "+" and "-", as well as a field for entering a number. After entering the number and pressing the "+" button, the air conditioner increases the current temperature by degrees, but not beyond degrees (if the resulting temperature exceeds , it is set to ). When the "-" button is pressed with in the input field, the temperature decreases by degrees, but not below . Unfortunately, the currently set temperature is not displayed anywhere, but the initial temperature and the log of all button presses are available.
Write a program that determines the temperature set after all the changes.
The first line contains three integers , , (-100 \leq a \leq c \leq b \leq 100), where and are the boundaries of the allowed temperature range, and is the initial temperature. The second line contains an integer (0 \leq N \leq 100), the number of temperature changes. Each of the following lines describes a temperature change. The first character of each line ("+" or "-") indicates the button pressed, and immediately after (without a space) is a non-negative integer — the number entered in the input field at the moment of pressing the button. The number cannot exceed .
Output a single integer — the temperature set after all changes.
Example 1