palindrome simulate