try:
if s.startswith('0') and len(s)>1:
return 0
if s.startswith('-0'):
return 0
i=int(s)
if i>65536 or i return 0
return i
except:
return 0
print(intParse('121'))
print(intParse('222121'))
print(intParse('-121'))
print(intParse('0121'))
print(intParse('A121'))
print(intParse('-0121'))