There has been a bank robbery of epic proportions. We would like to check if the getaway vehicle used by the bank robbers passed through the intersection that we are monitoring.
We know the numberplate of the vehicle that was used. However, it is very likely that the robbers
switched the vehicle before they reached our intersection. Intelligence reports tell us that the
robbers purchased several vehicles from a single showroom at the same time, and hence they all
have sequential numberplates.
We would like to find the number that is immediately higher (successor) or immediately lower
(predecessor) than the getaway vehicle's number to try and catch one of their other vehicles too.
Input Format:
The first line of the input will give a list of distinct numberplates with each separated by space.
This line ends with a \n character. Every line that follows either starts with an S , < or > and is followed by a space and a number .
Each such line ends with a \n character. End of input is indicated by EOF character.
Get Free Quote!
398 Experts Online