Vasya's birthday is approaching and Lena decided to sew a patterned handkerchief to him as a present. Lena chose digits from 0 to *n* as the pattern. The digits will form a rhombus. The largest digit *n* should be located in the centre. The digits should decrease as they approach the edges. For example, for *n* = 5 the handkerchief pattern should look like that: 

Your task is to determine the way the handkerchief will look like by the given *n*.
The first line contains the single integer *n* (2 ≤ *n* ≤ 9).
2
    0
  0 1 0
0 1 2 1 0
  0 1 0
    0
3
      0
    0 1 0
  0 1 2 1 0
0 1 2 3 2 1 0
  0 1 2 1 0
    0 1 0
      0
4
        0
      0 1 0
    0 1 2 1 0
  0 1 2 3 2 1 0
0 1 2 3 4 3 2 1 0
  0 1 2 3 2 1 0
    0 1 2 1 0
      0 1 0
        0
5
          0
        0 1 0
      0 1 2 1 0
    0 1 2 3 2 1 0
  0 1 2 3 4 3 2 1 0
0 1 2 3 4 5 4 3 2 1 0
  0 1 2 3 4 3 2 1 0
    0 1 2 3 2 1 0
      0 1 2 1 0
        0 1 0
          0
6
            0
          0 1 0
        0 1 2 1 0
      0 1 2 3 2 1 0
    0 1 2 3 4 3 2 1 0
  0 1 2 3 4 5 4 3 2 1 0
0 1 2 3 4 5 6 5 4 3 2 1 0
  0 1 2 3 4 5 4 3 2 1 0
    0 1 2 3 4 3 2 1 0
      0 1 2 3 2 1 0
        0 1 2 1 0
          0 1 0
            0
7
              0
            0 1 0
          0 1 2 1 0
        0 1 2 3 2 1 0
      0 1 2 3 4 3 2 1 0
    0 1 2 3 4 5 4 3 2 1 0
  0 1 2 3 4 5 6 5 4 3 2 1 0
0 1 2 3 4 5 6 7 6 5 4 3 2 1 0
  0 1 2 3 4 5 6 5 4 3 2 1 0
    0 1 2 3 4 5 4 3 2 1 0
      0 1 2 3 4 3 2 1 0
        0 1 2 3 2 1 0
          0 1 2 1 0
            0 1 0
              0
8
                0
              0 1 0
            0 1 2 1 0
          0 1 2 3 2 1 0
        0 1 2 3 4 3 2 1 0
      0 1 2 3 4 5 4 3 2 1 0
    0 1 2 3 4 5 6 5 4 3 2 1 0
  0 1 2 3 4 5 6 7 6 5 4 3 2 1 0
0 1 2 3 4 5 6 7 8 7 6 5 4 3 2 1 0
  0 1 2 3 4 5 6 7 6 5 4 3 2 1 0
    0 1 2 3 4 5 6 5 4 3 2 1 0
      0 1 2 3 4 5 4 3 2 1 0
        0 1 2 3 4 3 2 1 0
          0 1 2 3 2 1 0
            0 1 2 1 0
              0 1 0
                0
9
                  0
                0 1 0
              0 1 2 1 0
            0 1 2 3 2 1 0
          0 1 2 3 4 3 2 1 0
        0 1 2 3 4 5 4 3 2 1 0
      0 1 2 3 4 5 6 5 4 3 2 1 0
    0 1 2 3 4 5 6 7 6 5 4 3 2 1 0
  0 1 2 3 4 5 6 7 8 7 6 5 4 3 2 1 0
0 1 2 3 4 5 6 7 8 9 8 7 6 5 4 3 2 1 0
  0 1 2 3 4 5 6 7 8 7 6 5 4 3 2 1 0
    0 1 2 3 4 5 6 7 6 5 4 3 2 1 0
      0 1 2 3 4 5 6 5 4 3 2 1 0
        0 1 2 3 4 5 4 3 2 1 0
          0 1 2 3 4 3 2 1 0
            0 1 2 3 2 1 0
              0 1 2...
def MadeStringFromDigits(number: int) -> str:
    halfString = " ".join(str(i) for i in range(0, number))

    return (halfString + " " + str(number) + " " + halfString[::-1]).strip()


num = int(input())

firstHalfHandkerchief = ""
secondtHalfHandkerchief = ""

step = 0

for currentNumber in range(0, num):
    firstHalfHandkerchief = firstHalfHandkerchief + (" " * ((num * 2) - step)) + MadeStringFromDigits(currentNumber) + "\n"
    if currentNumber == num - 1:
        secondtHalfHandkerchief = secondtHalfHandkerchief + (" " * (step + 2)) + MadeStringFromDigits((num - currentNumber) - 1)
    else:
        secondtHalfHandkerchief = secondtHalfHandkerchief + (" " * (step + 2)) + MadeStringFromDigits((num - currentNumber) - 1) + "\n"
    
    step += 2

result = firstHalfHandkerchief + MadeStringFromDigits(num) + '\n' + secondtHalfHandkerchief

print(result)