For this Question: Given a string S.
Let string A be it's longest palindromic suffix and string B be the longest palindromic prefix of string S.
String C = A + B 
Print the string C.The first line and the only line of the input contains a string S.

Constraints
1<=|S|<=100000Print the required answer.Sample Input 
aabb

Sample Output
bbaa

Explanation
longest prefix -> aa longest suffix ->bb

Sample Input 
aaaa

Sample Output
aaaaaaaa, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
    public static void main (String[] args) throws IOException {

        BufferedReader input = new BufferedReader( new InputStreamReader(System.in));

        String str = input.readLine();

        System.out.println( palindrome( str, str.length() ) );

    }

    public static String palindrome( String str, int n ) {

        String result = "";
        boolean suffix = false;
        boolean prefix = false;

        for( int k=n; k>0; k-- ) {

            if( !prefix && isPalindrome( str, 0, k-1 ) ) {

                result = result + str.substring( 0,k );
                prefix = true;
            }

            if( !suffix && isPalindrome( str, n-k, n-1 ) ) {

                result = str.substring( n-k, n ) + result;
                suffix = true;
            }

            if( suffix && prefix ) break;
        }

        return result;
    }

    public static boolean isPalindrome( String str, int i, int j ) {

        while( i<j ) {

            if( str.charAt(i) != str.charAt(j) ) return false;

            i++;
            j--;
        }

        return true;
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?