import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); String line=sc.nextLine(); line=line.replaceAll("[^A-Za-z]"," ").trim(); String[] strs=line.split("\\s+"); for(int i=strs.length-1;i>=0;i--){ System.out.print(strs[i]+" "); } } }