Learning the language of science is a lot like learning a new language. Scientists (all too) often use scientific words for common words that most of us already know. For example, a scientist will say neo instead of new or pseudo instead of fake (as in fake news). To learn science, you also need to learn this new language.

In modern science and its applied fields such as technology and medicine, a knowledge of classical languages is not as rigid a prerequisite as it used to be. However, traces of their influence remain. Firstly, languages such as Greek, Latin and Arabic — either directly or via more recently derived languages such as French — have provided not only most of the technical terms used in Western science, but also a de facto vocabulary of roots, prefixes and suffixes for the construction of new terms as required. Echoes of the consequences sound in remarks such as this one of Charles Prestwich Scott1:

Television? The word is half Latin and half Greek. No good can come of it.

referring to it being a hybrid word.

A special class of terminology that overwhelmingly is derived from classical sources, is biological classification2, in which binomial nomenclature3 still is most often based on classical origins. The derivations are arbitrary however and can be mixed variously with modernisms, late Latin, and even fictional roots, errors and whims. However, in spite of the chaotic nature of the field, it still is helpful to the biologist to have a good vocabulary of classical roots.

Systema Naturae
First edition of Systema Naturae4 by Carl Linnaeus, written in Neo-Latin.

Branches of science that are based — however tenuously — on fields of study known to the ancients, or that were established by more recent workers familiar with Greek and Latin, often use terminology that is fairly correct descriptive Latin, or occasionally Greek. Descriptive human anatomy or works on biological morphology often use such terms, for example, musculus gluteus maximus5 simply means the "largest rump muscle", where musculus6 was the Latin for "little mouse" and the name applied to muscles.

During the last two centuries there has been an increasing tendency to modernize the terminology, though how beneficial that might be is subject to discussion. In the end, all such words are so much terminology. It does not much matter whether modern users know that they are classical or not. Some distinct term is necessary for any meaningful concept, and if it is not classical, a modern coinage would not generally be any more comprehensible. Consider examples from computing such as byte7 or dongle8.

Assignment

A string $$u$$ is a prefix of a string $$s$$ if a string $$v$$ exists such that $$s = uv$$, or in other words if the string $$s$$ starts with the string $$u$$. A string $$u$$ is a common prefix of two strings $$s_1$$ and $$s_2$$ if strings $$v_1$$ and $$v_2$$ exist such that $$s_1 = uv_1$$ and $$s_2 = uv_2$$.

A string $$v$$ is a suffix of a string $$s$$ if a string $$u$$ exists such that $$s = uv$$, or in other words if the string $$s$$ ends with the string $$v$$. A string $$v$$ is a common suffix of two strings $$s_1$$ and $$s_2$$ if strings $$u_1$$ and $$u_2$$ exist such that $$s_1 = u_1v$$ and $$s_2 = u_2v$$.

By definition, the empty string and the string $$s$$ are respectively the shortest and the longest prefix and suffix of a string $$s$$. Determine the longest common prefix and the longest common suffix of two strings $$s_1$$ and $$s_2$$.

Input

Two words $$s_1$$ and $$s_2$$, each on a separate line.

Output

Three lines that use the following format:

stem1prefix┫     ┣suffixstem2

The middle line contains the longest common prefix (prefix) and the longest common suffix (suffix) of the words $$s_1$$ and $$s_2$$. The first (resp. third) line contains the stem of the first (resp. second) word: the fragment of the word in between the longest common prefix and suffix. None of these lines ends in spaces.

The width for the representation of the two stems corresponds to the length of the longest stem. Center the shortest stem against the longest stem.

Tip

The output format uses some special characters as connectors between the longest common prefix, the two stems and the longest common suffix. Copy and paste these characters to make sure that the same characters are used in your source code.

Example

Input:

interdisciplinary
interplanetary

Output:

     ┏disciplin┓
inter┫         ┣ary
     ┗  planet ┛

Example

Input:

herbivore
carnivore

Output:

┏herb┓
┫    ┣ivore
┗carn┛

Example

Input:

television
telephone

Output:

    ┏vision┓
tele┫      ┣
    ┗phone ┛