import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
String s=sc.nextLine();
int n=s.length();
int i=n-1;
int j=n-1;
StringBuilder sb=new StringBuilder();
while(j>=0){
while(j>=0 && !Character.isLetter(s.charAt(j))){
j--;
}
i=j;
while(j>=0 && Character.isLetter(s.charAt(j))){
j--;
}
sb.append(s.substring(j+1,i+1)+" ");
}
sb.deleteCharAt(sb.length()-1);
System.out.println(sb.toString());
}
}