Finding the longest palindrome from a user input