Under construction

Still being built. Things may change

String Explosion

Interview

Time limit2sMemory limit128 MB

Summary
Repeatedly delete every occurrence of the explosion string until none remains, printing FRULA when nothing is left.
Level

Medium5 of 10

Topics
Stack, String matching
Solved
No attempts yet

Problem

Sanggeun planted an explosion string inside a longer string. When the explosion string explodes, that part disappears from the string and the pieces on either side join together.

An explosion works like this.

  • If the string contains the explosion string, every occurrence of the explosion string explodes. The remaining pieces are joined in order to form a new string.
  • The new string may contain the explosion string again.
  • The explosions continue until the string no longer contains the explosion string.

Sanggeun wants to know which string is left once every explosion has finished. Sometimes no character is left. In that case, print FRULA.

The explosion string never contains the same character twice.

Input

The first line contains the string. Its length is at least 11 and at most 10610^6.

The second line contains the explosion string. Its length is at least 11 and at most 3636.

Both strings consist only of lowercase letters, uppercase letters, and the digits 00 through 99.

Output

Print the string that is left once every explosion has finished. If no character is left, print FRULA.

Examples2

  1. Example 1

    Input
    mirkovC4nizCC44
    C4
    
    Expected output
    mirkovniz
    
  2. Example 2

    Input
    12ab112ab2ab
    12ab
    
    Expected output
    FRULA