import java.util.; import java.io.; public class Main{ public static void main(String[] args)throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String str = null; while((str = in.readLine()) != null){ int len = str.length(); StringBuilder s = new StringBuilder(); for(int i = 0;i < len;i ++){ if((str.charAt(i) >= 'A' && str.charAt(i) <= 'Z') || (str.charAt(i) >= 'a' && str.charAt(i) <= 'z')){ s.append(str.charAt(i)); }else{ s.append(' '); } } String[] temp = String.valueOf(s).trim().split(" "); len = temp.length; for(int i = len-1;i >0;i--){ System.out.print(temp[i] +" "); } System.out.print(temp[0]); }

}

}