#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <list>
std::string word;
std::list<char> letters;
int main(){
std::getline(std::cin, word);
for(char a: word){
letters.push_back(a);
}
while(true){
std::getline(std::cin, word);
if(word.empty()){
for(char s : letters)
std::cout << s;
break;
}
else{
for (auto iter = letters.begin(); iter != letters.end(); ){
if(word.find(*iter) == std::string::npos){
letters.erase(iter);
}
else{
}
}
}
}
}