시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 66 4 2 14.286%

문제

모든 버그(bug)가 벌레라는 뜻은 아니다. 개발자에게 악몽인 버그도 있다. 이 버그는 바로 여러분이 아는 "니가 짠 프로그램에서 버그 발견됐다 ㅋ" 라고 말할 때 쓰는 버그다. 말 안해도 알겠지만 버그는 없애도 나오고 없애도 나온다. 젠장...

그래서 최근 "버그잡는 꿍" 이라고 불리는 꽤나 유용한 계획이 나타났다. 이 프로그램은 여러분의 소스에 있는 모든 버그를 찾아서 제거할 수 있다. 그래서 여러분은 소스코드에 나타난 모든 버그를 제거하는 프로그램인 "버그잡는 꿍" 프로그램을 만들어야 한다.

입력

입력은 몇 개의 테스트케이스로 이루어진다. 각 테스트 케이스는 T (0 ≤ T ≤ 100 000)를 포함하는 하나의 정수, 하나의 공백, 그리고 버그를 뜻하는 문자열 B로 시작한다.

다음 T줄에는 버그를 없애야 할 소스코드가 주어진다. 모든 버그는 대소문자가 구분되는 문자열 B에 의해 나타내어진다.

입력의 각 줄의 길이는 0~2,000,000 글자이며 버그를 나타내는 문자열 B는 1~1000개의 영어 대문자로 이루어져있다.

출력

소스코드에 나타난 모든 버그를 지운 결과를 출력한다.

출력 결과에는 절대 어떠한 버그도 나타나서는 안되며 그 외의, 공백을 포함한 모든 것들은 반드시 그대로 출력한다.

예제 입력 1

7 BUG
print "No bugs here..."

void hello() {
BUGBUG
  printfBUG("Hello, world!\n");
}

1 ERR
wriERRERRtelERRn("Hello E-R-R");

예제 출력 1

print "No bugs here..."

void hello() {

  printf("Hello, world!\n");
}

writeln("Hello E-R-R");
W3sicHJvYmxlbV9pZCI6IjY2MTMiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWJjODRcdWFkZjhcdWM3YTFcdWIyOTQgXHVhZmNkIiwiZGVzY3JpcHRpb24iOiI8cD48aW1nIGFsdD1cIlwiIHNyYz1cIlwvdXBsb2FkXC9pbWFnZXMyXC9zYi5wbmdcIi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