#P1358E. Are You Fired?
Are You Fired?
No submission language available for this problem.
Description
Levian works as an accountant in a large company. Levian knows how much the company has earned in each of the consecutive months — in the -th month the company had income equal to (positive income means profit, negative income means loss, zero income means no change). Because of the general self-isolation, the first months income might have been completely unstable, but then everything stabilized and for the last months the income was the same.
Levian decided to tell the directors numbers — the total income of the company for each consecutive months. In other words, for each between and he will say the value . For example, if and he will say the numbers .
Unfortunately, if at least one total income reported by Levian is not a profit (income ), the directors will get angry and fire the failed accountant.
Save Levian's career: find any such , that for each months in a row the company had made a profit, or report that it is impossible.
The first line contains a single integer () — the number of months for which Levian must account.
The second line contains integers , where () — the income of the company in the -th month.
Third line contains a single integer () — income in every month from to .
In a single line, print the appropriate integer or , if it does not exist.
If there are multiple possible answers, you can print any.
Input
The first line contains a single integer () — the number of months for which Levian must account.
The second line contains integers , where () — the income of the company in the -th month.
Third line contains a single integer () — income in every month from to .
Output
In a single line, print the appropriate integer or , if it does not exist.
If there are multiple possible answers, you can print any.
Samples
Note
In the first example, and satisfy: in the first case, Levian will report the numbers , and in the second case — one number .
In the second example, there is no such .
In the third example, the only answer is : he will report the numbers .