#include <iostream>
#include <string>
using namespace std;
int main() {
string str;
char target;
getline(cin, str);
cin >> target;
for (char &c : str) {
if (c == target) {
c = '#';
}
}
cout << str << endl;
return 0;
}