# Given a string, find out if its characters can be rearranged to form a palindrome.

# Example

# For inputString = "aabb", the output should be
# palindromeRearranging(inputString) = true.

# We can rearrange "aabb" to make "abba", which is a palindrome.

def palindromeRearranging(inputString):

	lista = list(inputString)
	long = len(lista)

	#Check if there is at least an even number for each word, except for one exception: the words with un odd number of letters
	lista = sorted(lista)
	err = 0
	elem = 1
	#print(lista)
	for i in range(long-1):
		#Loop from the second element. The second has to be equal to the first. if not give an error,
		#print ('Letter index: ',i,' Letter: ',lista[i], 'elem: ',elem)
		#print ('prev: ',lista[i-1])
		#print ('Next: ',lista[i+1])
		
		if lista[i]==lista[i+1]:
			#It is the same element
			elem = elem + 1
			if i== long-2:
				if elem%2 != 0:
					#print ("El error era: ",err)
					err = err + 1
					#print ("Ahora error: ",err)
					if err == 2:
						return False

		else:
			#If it is a new element
			#print ("Cambiamos!La letra se repitió: ",elem)
			if elem%2 != 0:
				#print ("El error era: ",err)
				err = err + 1
			elem = 1
			if i == long-2:
				err = err + 1
			#print ("Ahora error: ",err)
			if err == 2:
				return False
			#print("Wrong!")
	return True