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.
Place A and B so the chosen letters occupy the same cell. Fill every other empty cell with ..
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.
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.