{"raw_statement":[{"iden":"problem statement","content":"There are $N$ platforms arranged in a row. The height of the $i$\\-th platform from the left is $H_i$.\nTakahashi is initially standing on the leftmost platform.\nSince he likes heights, he will repeat the following move as long as possible.\n\n*   If the platform he is standing on is not the rightmost one, and the next platform to the right has a height greater than that of the current platform, step onto the next platform.\n\nFind the height of the final platform he will stand on."},{"iden":"constraints","content":"*   $2 \\leq N \\leq 10^5$\n*   $1 \\leq H_i \\leq 10^9$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$H_1$ $\\ldots$ $H_N$"},{"iden":"sample input 1","content":"5\n1 5 10 4 2"},{"iden":"sample output 1","content":"10\n\nTakahashi is initially standing on the leftmost platform, whose height is $1$. The next platform to the right has a height of $5$ and is higher than the current platform, so he steps onto it.\nHe is now standing on the $2$\\-nd platform from the left, whose height is $5$. The next platform to the right has a height of $10$ and is higher than the current platform, so he steps onto it.\nHe is now standing on the $3$\\-rd platform from the left, whose height is $10$. The next platform to the right has a height of $4$ and is lower than the current platform, so he stops moving.\nThus, the height of the final platform Takahashi will stand on is $10$."},{"iden":"sample input 2","content":"3\n100 1000 100000"},{"iden":"sample output 2","content":"100000"},{"iden":"sample input 3","content":"4\n27 1828 1828 9242"},{"iden":"sample output 3","content":"1828"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}