import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static void initialize(String s) { } static int answerQuery(int l, int r,String s) { // Return the answer for this query modulo 1000000007. s =s.substring(l-1,r); int i=0,j=0; //System.out.println(s); int n=s.length(); //List h= new ArrayList(); HashMap hm= new HashMap(); //h=printAllPalindromes(s); //System.out.println(h); for(i=0;i printAllPalindromes(String input) { // if (input.length() <= 2) { // return Collections.emptySet(); //} List out = new ArrayList(); int length = input.length(); for (int i = 1; i <= length; i++) { for (int j = i - 1, k = i; j >= 0 && k < length; j--, k++) { if (input.charAt(j) == input.charAt(k)) { out.add(input.substring(j, k + 1)); } else { break; } } } return out; } public static void printAllPalindrome(String str) { for(int i=0;i<=str.length();i++) for(int j=i;j