#include<iostream>
using namespace std;
int main() {
// Initialize array of 5 letters
char letters[10];
// Receive 5 letters from user
cout << "Enter 10 letters: ";
for(int i=0; i<10; i++)
cin >> letters[i];
// Print letters in reverse order
for(int i=9; i>=0; i--)
// If letter repeats in input, don't repeat on output
if(i>0 && letters[i]!=letters[i-1])
cout << letters[i];
// Print new line at end
cout << endl;
return 0;
}