An odometer display reverses the decimal digits of a signed reading while keeping its sign. Given an integer x that fits in a signed 32-bit range, reverse the order of its digits (dropping any leading zeros that result) and keep the original sign. If the reversed value falls outside the signed 32-bit range [-2147483648, 2147483647], the display cannot show it, so output 0 instead.
Input format
Line 1: an integer x with -2147483648 <= x <= 2147483647.
Output format
A single integer: the digit-reversed value, or 0 if that value would not fit in signed 32-bit range.
Constraints
- -2147483648 <= x <= 2147483647