#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int HashT[128]={0};
int main(int argc, char** argv) {
// printf("%d",'+');
char str1[100005],str2[100005];
gets(str1); gets(str2);
for(int i=0;i<strlen(str1);i++){
if(str1[i]>='A' && str1[i]<='Z') HashT[str1[i]-'0'+'a'-'A']=1;
else HashT[str1[i]-'0']=1;
}
bool flag=false;
for(int u=0;u<strlen(str1);u++){
if(str1[u]=='+'){
flag=true;break;
}
}
int count=0;
for(int i=0;i<strlen(str2);i++){
if(HashT[str2[i]-'0']==0) {
if(flag==true && str2[i]>='A' && str2[i]<='Z') continue;
printf("%c",str2[i]);
count++;
}
}
if(count==0) printf("\n");
return 0;
}
#include <cstdio>
#include <cstring>
using namespace std;
int HashT[128]={0};
int main(int argc, char** argv) {
// printf("%d",'+');
char str1[100005],str2[100005];
gets(str1); gets(str2);
for(int i=0;i<strlen(str1);i++){
if(str1[i]>='A' && str1[i]<='Z') HashT[str1[i]-'0'+'a'-'A']=1;
else HashT[str1[i]-'0']=1;
}
bool flag=false;
for(int u=0;u<strlen(str1);u++){
if(str1[u]=='+'){
flag=true;break;
}
}
int count=0;
for(int i=0;i<strlen(str2);i++){
if(HashT[str2[i]-'0']==0) {
if(flag==true && str2[i]>='A' && str2[i]<='Z') continue;
printf("%c",str2[i]);
count++;
}
}
if(count==0) printf("\n");
return 0;
}