Peter Pan Frame

Time limit1sMemory limit128 MB

Summary
Draw a 5-row banner where each letter of a word sits in a diamond of '#' or '*' depending on its position, with overlapping frames resolved by priority.
Level

Medium5 of 10

Topics
Simulation, String, Implementation
Solved
No attempts yet

Problem

A "Peter Pan frame" decorates one alphabet letter by placing it inside a diamond made of # characters. A "Wendy frame" has the same shape, but the diamond is made of * characters.

Given a word, decorate every letter whose 1-based position is a multiple of 3 with a Wendy frame. Decorate all other letters with a Peter Pan frame.

If a Wendy frame and a Peter Pan frame overlap, the Wendy frame's * takes priority over the Peter Pan frame's #.

Input

The first line contains a word consisting only of uppercase English letters. The word has length at most 15.

Output

Print exactly five lines: the given word decorated with the required frames.

Examples3

  1. Example 1

    Input
    A
    
    Expected output
    ..#..
    .#.#.
    #.A.#
    .#.#.
    ..#..
    
  2. Example 2

    Input
    DOG
    
    Expected output
    ..#...#...*..
    .#.#.#.#.*.*.
    #.D.#.O.*.G.*
    .#.#.#.#.*.*.
    ..#...#...*..
    
  3. Example 3

    Input
    ABCD
    
    Expected output
    ..#...#...*...#..
    .#.#.#.#.*.*.#.#.
    #.A.#.B.*.C.*.D.#
    .#.#.#.#.*.*.#.#.
    ..#...#...*...#..