# the constraints mention the numbers cannot be greater than 10^4, so you also have to check for that