For this Question: Find the logic of transformation that converts the following i/p to o/p and program it. 

Abbreviation meaning:
i/p - Input
o/p - Output

 	 	 									
i/p: But, why?
o/p: But,? yhw

i/p: My Rhythms fly
o/p: My smhtyhR fly

i/p: Hi, my name is ted. I am fine
o/p: Hi, ym name si ted. I am enif

i/p: peace out
o/p: peace tuoThe input contains a single string S.

Constraints:-
1 <= |S| <= 100000Print the output by figuring out the logicSample Input:-
newton school

Sample Output:-
newton loohcs

Sample input:-
My Rhythms fly

Sample Output:-
My smhtyhR fly, I have written this Solution Code: import java.io.*;
import java.util.*;



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

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

        StringTokenizer st
            = new StringTokenizer(br.readLine());
        int n = 1;

        StringBuilder ans = new StringBuilder();

        while(st.hasMoreTokens()){
            StringBuilder s = new StringBuilder(st.nextToken());

            if(n % 2 == 0){
                ans.append(s.reverse() + " ");
            }
            else{
                ans.append(s + " ");
            }
            n++;
        }

        System.out.println(ans);
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?