'''

class Solution:

def reverse(self, x):

"""

:type x: int

:rtype: int

"""

if x == int('0'):

return 0

x = str(x)

sign = str()

if int(x).bit_length() <= 32:

if '-' in x:

sign = (x.partition('-')[1])

y = x.strip('-')

y = y.strip('0')

rev = y[::-1]

if int(rev).bit_length() < 32:

if sign == '-':

return int(sign+rev)

else:

return int(rev)

else:

return 0

else:

return 0

'''