public class Shuffle 
{
  public static void main(String[] args) {
    In.open("shuffle.in.txt");
    Out.open("shuffle.out.txt");
    
    char ch;
    do {
      ch = In.read();
      if(isLetter(ch)) {
        StringBuffer word = new StringBuffer();
        while(In.done() && isLetter(ch)) {
          word.append(ch);
          ch = In.read();
        }
        if(word.length() > 3) shuffle(word);
        Out.print(word.toString());
      }
      
      if(In.done())
        Out.print(ch);
        
    } while(In.done());
    
    Out.close();
    In.close();
  }
  
  static boolean isLetter(char ch) {
    return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z');
  }
  
  static void shuffle(StringBuffer word) {
    // "Programmiergrundlagen"
    //  012345678901234567890
    //   ^                 ^
    // start -->      <-- end
    for(int start = 1, end = word.length() - 2; start < end; start++, end--) {
      char temp = word.charAt(end);
      word.setCharAt(end, word.charAt(start));
      word.setCharAt(start, temp);
    }
  }
}

