import java.util.*;
public class TestOne {
public static void main(String[] args) {
ArrayDeque<String>stack=new ArrayDeque<>();
ArrayDeque<String>rest=new ArrayDeque<>();
StringBuffer result=new StringBuffer();
Scanner scanner=new Scanner(System.in);
String input=scanner.nextLine();
String[] strlist=input.split(" ");
for(String i:strlist){
if(stack.isEmpty()){
stack.push(i);
}
else{
if( !stack.peek().toLowerCase().equals(i.toLowerCase())) {stack.push(i);}
else {continue;}
}
}
while(!stack.isEmpty()){
rest.push(stack.peek());
stack.pop();
}
while(!rest.isEmpty()){
result.append(rest.peek()).append(" ");
rest.pop();
}
System.out.println(result.toString());
}
}