Parse an Integer
Convert the text to an integer without using your language's built-in conversion. The text may have spaces around it and an optional + or -. If anything else appears, print Invalid.
Input
One line of text.
Output
The integer or Invalid.
Constraints
At most 15 characters.
Sample 1
Input
-42
Output
-42
Sample 2
Input
4193 words
Output
Invalid