Toblerone is a Swiss chocolate brand that was created in 1908 by Emil Baumann and has cousin Theodor Tobler. Emil created the unique recipe consisting of milk chocolate including nougat, almonds and honey. The brand is now owned by US company Mondelēz International1 (known as Kraft Foods, Inc.2 until 2012), which acquired it from its owner Jacobs Suchard in 1990. The chocolate bar is known for its distinctive shape — a series of joined triangular prisms that resemble the Matterhorn3 in the Swiss Alps — its yellow triangular box and its lettering engraved in the chocolate.

Toblerone
A Toblerone bar.

The chocolate bar is produced in Bern4 — capital of Switzerland. That city is also hidden in the brand name: Toblerone. The logo of the brand represents the Matterhorn with a bear hidden inside — the symbol of the city of Bern.

bear
The logo of the brand represents the Matterhorn with a bear hidden inside — the symbol of the city of Bern.

Assignment

You get a brand name and a city whose name is hidden in the brand name. The brand name may consist of letters and other characters, but the name of the city only consists of letters. Mark the letters of the brand name that spell the name of the city if we only keep those letters of the brand name and remove all other characters from the brand name. For example, the brand name Coca-Cola hides the city of Ocala5 (Florida, USA). Note that we do not make a distinction between uppercase and lowercase letters, and that we keep the spelling of the letters in the brand name.

This task does not necessarily have a unique solution, but we will make it unambiguous by proceeding as follows. We traverse the characters of the brand name from left to right and start looking for the first letter of the city name. If a character of the brand name matches the letter of the city we are looking for (without making a distinction between uppercase and lowercase letters), we mark that character and then search for the next letter of the city name. Otherwise, the character of the brand name is left unmarked, and we continue searching for the same letter of the city name. If all letters of the city name have been marked in the brand name, no more characters of the brand name need to be marked.

Coca-Cola
The city named Ocala (Florida, USA) is hidden in the name of the brand Coca-Cola.

So far we have marked characters in the brand name by putting them in bold and underling them (Coca-Cola). For this assignment, however, you must enclose marked letters between square brackets. If we start by separately enclosing the letters of Ocala between square brackets in Coca-Cola, we get C[o][c][a]-Co[l][a]. However, the goal is to enclose consecutive sequences of marked letters between the same pair of square brackets. This can be done afterwards by removing all combinations of a closing square bracket (]) that is immediately followed by an opening square bracket ([). If we mark those combinations in blue we get C[o][c][a]-Co[l][a], and if we remove them we get C[oca]-Co[la].

Input

The first line contains a brand name that may consist of letters and other characters.

The second line contains a city name that only consists of letters. The city name is also hidden in the brand name.

Output

The brand name in which the letters of the hidden city are marked with square brackets. Consecutive sequences of marked letters must be enclosed between the same pair of square brackets. When comparing characters, no distinction should be make between uppercase and lowercase letters, and the spelling of the letters in the brand name must be preserved.

Example

Input:

Toblerone
Bern

Output:

To[b]l[er]o[n]e

Example

Input:

Coca-Cola
Ocala

Output:

C[oca]-Co[la]

Epilogue

The iconic Swiss mountain Matterhorn, which until 2023 adorned the packaging of the equally iconic Swiss chocolate bar Toblerone, now has made way for a "generic" mountain.

Switzerland has strict rules for using national symbols on product packaging. The packaging of Toblerone had to be changed in 2023 to comply with Swiss legislation from 2017, which stipulates that national symbols may not be used on packaging if the product does not meet certain criteria. For example, food with Swiss symbols must be made with at least 80 percent raw materials from Switzerland. For milk and dairy products, such as Toblerone, at 100 percent raw materials must come from Switzerland. Moreover, the essential production must take place in Switzerland.

And that's where problems arose. From July 2023, Mondelēz moved part of the production of Toblerone to Bratislava, Slovakia. Outside Switzerland. According to the company, the move was necessary to meet global demand and grow the brand in the future.