N different palindromes

CodeChef - NDIFFPAL