import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNextLine()){
String str=sc.nextLine();
String[] strArray=str.split("[^A-Za-z]");
StringBuilder sb=new StringBuilder();
for(int i=strArray.length-1;i>=0;i--){
sb.append(strArray[i]).append(" ");
}
System.out.println(sb.toString());
}
}
}
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNextLine()){
String str=sc.nextLine();
String[] strArray=str.split("[^A-Za-z]");
StringBuilder sb=new StringBuilder();
for(int i=strArray.length-1;i>=0;i--){
sb.append(strArray[i]).append(" ");
}
System.out.println(sb.toString());
}
}
}