Make a Crossword

Time limit1sMemory limit128 MB

Problem

Given two words A and B, build a crossword-shaped grid.

Write A once horizontally and B once vertically. The two words must cross at exactly one shared letter. Choose the crossing letter by these rules.

  1. Scan A from left to right and pick the first letter that also appears in B.
  2. If that letter appears multiple times in B, use its first position in B.

Place A and B so the chosen letters occupy the same cell. Fill every other empty cell with ..

Input

The first line contains two words A and B separated by a space. Each word has length at most 30, consists only of uppercase English letters, and the two words share at least one letter.

Output

Let M be the length of B and N be the length of A. Print M lines, each containing exactly N characters. Print the grid where the two words cross by the rule above, and print . in every cell not occupied by a word.