#include <iostream> #include <string> #include <cstdio> #include <iostream> using namespace std; int main() { string line, bug; int T; unsigned pos; while (scanf("%d ", &T) == 1) { getline(cin, bug); for (;T;T--) { getline(cin, line); while ((pos = line.find(bug)) != string::npos) line.erase(pos, bug.length()); printf("%s\n", line.c_str()); } } return 0; }