#Q50. 「一本通 2.2 练习 4」Censoring

「一本通 2.2 练习 4」Censoring

Description

Original source: USACO 2015 Feb. Silver

Given two strings SS and TT, repeatedly find a substring A=TA = T in SS from front to back, delete it, and fill the gap by shifting the remaining characters forward. Repeat this process until SS no longer contains TT as a substring. Output the final string SS.

Input Format

The first line contains a string SS, and the second line contains a string TT.

Output Format

Output the processed string SS.

Sample 1

whatthemomooofun
moo

whatthefun

Constraints & Hints

For all test cases, 1TS1061\le |T|\le |S|\le 10^6, and it is guaranteed that the strings consist only of lowercase letters.