import java.util.*;
import java.util.regex.*;
public class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNext()){
            String str = scanner.nextLine();
            String[] strs = str.split("[^A-Za-z]");
            StringBuffer buffer = new StringBuffer();
            String  a ="";
            for(int i=strs.length-1;i>=0;i--){
                buffer.append(strs[i]+" ");
            }
            System.out.print(buffer.toString().trim());
        }
    }
}