#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
string str;
getline(cin, str);
char cmd,s,a1, a2;
int flag = 0;
cin >> cmd;
int len = str.length();
if (cmd == 'D') //删除
{
cin >> s;
int pos = str.find(s);
if (pos < 0)
{