시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB0000.000%

문제

A word diamond is formed from a word that begins and ends with the same letter. Consider this word diamond for the word 'ENCODE':

     E
    N N
   C   C
  O     O
 D       D
E         E
 D       D
  O     O
   C   C
    N N
     E

The leftmost letter of the diamond just touches the left margin. A shorter diamond, e.g., for the word 'DAD' looks like this:

  D
 A A
D   D
 A A
  D
      
Write a program that reads in a word and prints the word diamond associated with that word.

입력

A single line with a word that:

  • Has all capital letters
  • Has the same first and last letters
  • Is between 3 and 13 letters in length

출력

The word diamond itself. The word diamond for a word of length N has 2*N-1 lines. There are no spaces at the end of any line.

예제 입력 1

DAD

예제 출력 1

  D
 A A
D   D
 A A
  D