eolymp
Competitions

Робота з рядками

Pyramid of the symbols

Vasya wants to print on your printer pyramid of some sort of symbol height h. Write a program that will help him in this, not forgetting that the program must be "_economically viable_", i.e. to print the least amount of characters.

Examples of pyramids are shown in the examples of input and output data. For clarity, printed blanks are replaced by point.

Input

In a single line given first symbol, by which must be printed pyramid, and then through a gap and a positive integer specifying the height of the pyramid h (h50).

Output

In the first line print the total number of "printing" characters and below the pyramid itself.

Time limit 1 second
Memory limit 128 MiB
Input example #1
A 3
Output example #1
12
  A
 AAA
AAAAA
Input example #2
M 9
Output example #2
117
        M
       MMM
      MMMMM
     MMMMMMM
    MMMMMMMMM
   MMMMMMMMMMM
  MMMMMMMMMMMMM
 MMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMM
Source Stage II All-Ukrainian Olympiad 2010-2011 Berdichev