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...
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "98223711",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3\n",
      "      0\n",
      "    0 1 0\n",
      "  0 1 2 1 0\n",
      "0 1 2 3 2 1 0\n",
      "  0 1 2 1 0\n",
      "    0 1 0\n",
      "      0\n"
     ]
    }
   ],
   "source": [
    "n = int(input())\n",
    "\n",
    "r_c = 1\n",
    "r_r = 1\n",
    "\n",
    "c_n = -n\n",
    "\n",
    "for i in range(n * 2 + 1):\n",
    "    c_n_r = c_n\n",
    "    r_c = 1\n",
    "    \n",
    "    for j in range(n * 2 + 1):\n",
    "        if c_n_r >= 0:\n",
    "            print(c_n_r, end = \"\" if (r_c == -1 and c_n_r == 0) else \" \")\n",
    "        else:\n",
    "            if r_c == 1:\n",
    "                print(\" \", end = \" \")\n",
    "            else:\n",
    "                break \n",
    "        \n",
    "        c_n_r += r_c\n",
    "        \n",
    "        if j == n - 1:\n",
    "            r_c = -1\n",
    "    \n",
    "    if i == n:\n",
    "        r_r = -1\n",
    "    \n",
    "    c_n += r_r\n",
    "        \n",
    "    print()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "060dd35a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Current working directory: /home/khadija\n"
     ]
    }
   ],
   "source": [
    "import os \n",
    "cwd = os.getcwd() \n",
    "print(\"Current working directory:\", cwd) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "cebef701",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Current working directory before\n",
      "/home/khadija\n",
      "\n",
      "Current working directory before\n",
      "/home/khadija/Bureau\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import os \n",
    "def current_path(): \n",
    "    print(\"Current working directory before\") \n",
    "    print(os.getcwd()) \n",
    "    print() \n",
    "current_path() \n",
    "os.chdir('/home/khadija/Bureau/') \n",
    "current_path() "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "ecdd00e9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Current working directory: /home/khadija/Bureau\n"
     ]
    }
   ],
   "source": [
    "import os \n",
    "cwd = os.getcwd() \n",
    "print(\"Current working directory:\", cwd) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9b231eb6",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
