class Solution:
def reverse(self, x: int) -> int:
split = [i for i in str(x)]
split = split[::-1]
final = ''
if split[-1]=='-':
final += '-'
for i in split[0:-1]:
print(i)
final+=i
else:
for i in split[0:]:
final+=i
final = int(final)
if(abs(final) > (2 ** 31 - 1)):
return 0
return(final)