String Censorship

Time limit1.5sMemory limit128 MB

Problem

Given a text T and a forbidden word A, remove occurrences of A by repeating the following procedure.

  1. If the current text does not contain A, stop.
  2. Delete the first occurrence of A in the current text.
  3. If the current text does not contain A, stop.
  4. Delete the last occurrence of A in the current text.
  5. Go back to step 1.

Write a program that prints the text remaining after the whole procedure finishes.

Input

The first line contains the word A. The second line contains the text T.

Both A and T consist only of lowercase English letters. The length of A is at most 25, and the length of T is at most 300,000.

Output

Print the text remaining after all censorship steps are complete.