#include<iostream>
using namespace std;
#include<cstring>
//字符串字符的删除
void Delete1(char s[],char ch) //数组接收
{
int len1=strlen(s);
char a[40];int j=0;
for(int i=0;i<len1;i++)
{
if(s[i]!=ch) a[j++]=s[i];
}
a[j]='\0';
strcpy(s,a);
}
void Delete2(char *p,char ch) //指针接收
{
int len=0;
for(int i=0;p[i]!='\0';i++)
{
if(p[i]!=ch) p[len++]=p[i];
}
p[len]=0;
}
int main()
{ char arr[40],ch1,ch2;
cin.getline(arr,40,'\n');//接收字符串
cin>>ch1;
Delete1(arr,ch1);
cout<<arr<<endl;
cin>>ch2;
Delete2(arr,ch2);
cout<<arr<<endl;
return 0;
}