#include <iostream>
#include <string>
using namespace std;
int main() {
string a, b;
while(getline(cin, a) && getline(cin, b)){
for(char letter ='a'; letter <= 'z'; ){
if((a.find(letter)!=string::npos) &&
(b.find(letter)!=string::npos)){
cout << letter;
a.erase(a.find(letter),1); /* стираем найденную
букву в первой строке */
b.erase(b.find(letter),1); /* стираем найденную
букву во второй строке */
}
else letter++;
}
cout << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglzdHJpbmcgYSwgYjsKCXdoaWxlKGdldGxpbmUoY2luLCBhKSAmJiBnZXRsaW5lKGNpbiwgYikpewoJCWZvcihjaGFyIGxldHRlciA9J2EnOyBsZXR0ZXIgPD0gJ3onOyApewoJCQlpZigoYS5maW5kKGxldHRlcikhPXN0cmluZzo6bnBvcykgJiYgCgkJCQkoYi5maW5kKGxldHRlcikhPXN0cmluZzo6bnBvcykpewoJCQkJY291dCA8PCBsZXR0ZXI7CgkJCQlhLmVyYXNlKGEuZmluZChsZXR0ZXIpLDEpOyAvKiDRgdGC0LjRgNCw0LXQvCDQvdCw0LnQtNC10L3QvdGD0Y4gCgkJCQnQsdGD0LrQstGDINCyINC/0LXRgNCy0L7QuSDRgdGC0YDQvtC60LUgKi8KCQkJCWIuZXJhc2UoYi5maW5kKGxldHRlciksMSk7IC8qINGB0YLQuNGA0LDQtdC8INC90LDQudC00LXQvdC90YPRjiAKCQkJCdCx0YPQutCy0YMg0LLQviDQstGC0L7RgNC+0Lkg0YHRgtGA0L7QutC1ICovCgkJCX0KCQkJZWxzZSBsZXR0ZXIrKzsKCQkKCQl9Cgljb3V0IDw8IGVuZGw7Cgl9CgoJcmV0dXJuIDA7Cn0=