Ho, Ho, Ho!
It's Christmas time and our friendly grandpa Santa Claus is busy distributing gifts to all the nice children. With the rising population, Santa's workload every year gets increased and he seeks your help to wrap the gifts with fancy wrapping papers while he gets them distributed. 
Everything was going great until you realised that you'll fall short of wrapping paper. But luckily, you get a very innovative idea, that will allow you to pack all the remaining gifts without worrying about lack of wrapping paper. Any guesses what the idea is? Using ice for wrapping, obviously! That's the only thing available at the North Pole.
Now, in order to reduce your trips to the ice factory, you decide to write a program that helps you visualize how much ice is needed for a particular gift. 

-----Input:-----
Input will consist of a single line with size $n$.

-----Output:-----
Print the ice wrapped gift box for the given size. 

-----Constraints-----
- $0 \leq n \leq 1000$

-----Sample Input:-----
4

-----Sample Output:-----
4 4 4 4 4 4 4
4 3 3 3 3 3 4
4 3 2 2 2 3 4
4 3 2 1 2 3 4
4 3 2 2 2 3 4 
4 3 3 3 3 3 4
4 4 4 4 4 4 4

Difficulty: UNKNOWN_DIFFICULTY

Starter code:

Solutions:
def read_i_l(l=False):
	m = list(map(int, input().strip().split(' ')))
	if l:
		return list(m)
	else:
		return m

def i():
	return int(input().strip())
T = i()
L = []
if T >= 1:
	L = ['1']
for i in range(2, T + 1):
	nL = [str(i) + (2 * i - 2) * (' ' + str(i))]
	for l in L:
		nL.append(str(i) + ' ' + l + ' ' + str(i))
	nL.append(str(i) + (2 * i - 2) * (' ' + str(i)))
	L = nL
for l in L:
	print(l)


num = int(input())
mat = [[-1 for i in range(num * 2 - 1)] for j in range(num * 2 - 1)]
cs = 0
rs = 0
re = len(mat) - 1
ce = len(mat) - 1
while num:
	t = num * 2 - 1
	for i in range(cs, ce + 1):
		mat[rs][i] = num
		mat[re][i] = num
	for j in range(rs, re):
		mat[j][cs] = num
		mat[j][ce] = num
	num -= 1
	rs += 1
	cs += 1
	re -= 1
	ce -= 1
for i in mat:
	print(*i)


MAX = 1000

def prints(a, size):
	for i in range(size):
		for j in range(size):
			print(a[i][j], end=' ')
		print()

def innerPattern(n):
	size = 2 * n - 1
	front = 0
	back = size - 1
	a = [[0 for i in range(MAX)] for i in range(MAX)]
	while n != 0:
		for i in range(front, back + 1):
			for j in range(front, back + 1):
				if i == front or i == back or j == front or (j == back):
					a[i][j] = n
		front += 1
		back -= 1
		n -= 1
	prints(a, size)
n = int(input())
innerPattern(n)


def printGift(n):
	dim = 2 * n - 1
	start = 0
	end = dim - 1
	a = [[0 for i in range(10000)] for i in range(10000)]
	while n != 0:
		for i in range(start, end + 1):
			for j in range(start, end + 1):
				if i == start or i == end or j == start or (j == end):
					a[i][j] = n
		start += 1
		end -= 1
		n -= 1
	for i in range(dim):
		for j in range(dim):
			print(a[i][j], end=' ')
		print()

def __starting_point():
	n = int(input())
	printGift(n)
__starting_point()


def pattern(n):
	s = 2 * n - 1
	for i in range(0, s // 2 + 1):
		m = n
		for j in range(0, i):
			print(m, end=' ')
			m -= 1
		for k in range(0, s - 2 * i):
			print(n - i, end=' ')
		m = n - i + 1
		for l in range(0, i):
			print(m, end=' ')
			m += 1
		print('')
	for i in range(s // 2 - 1, -1, -1):
		m = n
		for j in range(0, i):
			print(m, end=' ')
			m -= 1
		for k in range(0, s - 2 * i):
			print(n - i, end=' ')
		m = n - i + 1
		for l in range(0, i):
			print(m, end=' ')
			m += 1
		print('')

def __starting_point():
	n = int(input())
	pattern(n)
__starting_point()


n = int(input())
if n == 0:
	print()
elif n == 1:
	print(1)
elif n == 2:
	print(2, 2, 2)
	print(2, 1, 2)
	print(2, 2, 2)
else:
	l = [i for i in range(1, n + 1)]
	a = []
	for i in range(2 * n - 1):
		a1 = []
		for i in range(2 * n - 1):
			a1.append(0)
		a.append(a1)
	col1 = 0
	coln = 2 * n - 2
	row1 = 0
	rown = 2 * n - 2
	c = n
	while True:
		for i in range(2 * n - 1):
			if a[i][col1] == 0:
				a[i][col1] = c
		for i in range(2 * n - 1):
			if a[i][coln] == 0:
				a[i][coln] = c
		for i in range(2 * n - 1):
			if a[row1][i] == 0:
				a[row1][i] = c
		for i in range(2 * n - 1):
			if a[rown][i] == 0:
				a[rown][i] = c
		c -= 1
		if c == 0:
			break
		col1 += 1
		coln -= 1
		row1 += 1
		rown -= 1
	for i in a:
		print(*i)


n = int(input())
l = n * 2 - 1
for i in range(l):
	for j in range(l):
		mins = min(i, j)
		if mins >= l - i:
			mins = l - i - 1
		mins = min(mins, l - j - 1)
		print(n - mins, end=' ')
	print()


n = int(input())
k = n
m = 0
t = 0
d = 2 * n - 2
for i in range(n):
	l = i + 1
	k = n
	for j in range(i + 1):
		print(k, end=' ')
		k -= 1
	g = d - m
	while g - t > 0:
		print(k + 1, end=' ')
		g -= 1
	h = m
	k += 2
	while h > 0:
		print(k, end=' ')
		h -= 1
		k += 1
	m += 1
	t += 1
	print()
k = n - 1
t = 1
m -= 1
for i in range(n - 1):
	l = k - i
	d = k + 1
	for j in range(l, 0, -1):
		print(d, end=' ')
		d -= 1
	f = t
	while f > 0:
		print(d + 1, end=' ')
		f -= 1
	b = d + 1
	v = m
	while v > 0:
		print(b, end=' ')
		v -= 1
		b += 1
	t += 2
	m -= 1
	print()


n = int(input())
val = 2 * n - 1
x = 2
for i in range(val):
	k = n + 1
	h = -1
	count = 0
	for j in range(val):
		if i < n:
			if h < i:
				h += 1
				k -= 1
				print(k, end=' ')
				if h == i:
					count = 1
					val1 = 2 * k - 1
			elif count > 0 and count < val1:
				count += 1
				print(k, end=' ')
			else:
				k += 1
				print(k, end=' ')
		elif h < i and k != x and (count == 0):
			h += 1
			k -= 1
			print(k, end=' ')
			if k == x:
				count = 1
				val1 = 2 * x - 1
		elif count < val1:
			count += 1
			print(k, end=' ')
		else:
			k += 1
			print(k, end=' ')
	if i >= n:
		x += 1
	print()


n = int(input())
for i in range(n, 0, -1):
	k = n
	j = 1
	while j <= 2 * n - 1:
		print(k, end=' ')
		j += 1
		if i < k:
			k -= 1
		if i == k:
			for l in range(2 * k - 1):
				if j > 2 * n - 1:
					break
				print(k, end=' ')
				j += 1
			k += 1
			while k != i:
				if j > 2 * n - 1:
					break
				print(k, end=' ')
				k += 1
				j += 1
	print()
for i in range(2, n + 1):
	k = n
	j = 1
	while j <= 2 * n - 1:
		print(k, end=' ')
		j += 1
		if i < k:
			k -= 1
		if i == k:
			for l in range(2 * k - 1):
				if j > 2 * n - 1:
					break
				print(k, end=' ')
				j += 1
			k += 1
			while k != i:
				if j > 2 * n - 1:
					break
				print(k, end=' ')
				k += 1
				j += 1
	print()


n = int(input())
l = [[1]]
if n == 1:
	pass
else:
	i = 2
	while i <= n:
		l1 = [i for j in range(2 * i - 3)]
		l.insert(0, l1)
		for j in l:
			j.append(i)
			j.insert(0, i)
		i += 1
for i in l:
	print(*i)
for i in range(len(l) - 2, -1, -1):
	print(*l[i])


n = int(input())
a = []
size = 2 * n - 1
b = [n] * size
size -= 2
curr = n - 1
a.append(b)
for i in range(n - 1):
	c = b.copy()
	c[i + 1:i + 1 + size] = [curr] * size
	a.append(c)
	b = c.copy()
	curr -= 1
	size -= 2
for i in range(len(a)):
	print(*a[i])
for i in range(len(a) - 2, -1, -1):
	print(*a[i])


n = int(input())
if n == 0:
	print(0)
else:
	l = [[0 for i in range(2 * n - 1)] for j in range(2 * n - 1)]
	for i in range(1, 2 * n):
		k = []
		for j in range(1, 2 * n):
			d = max(abs(i - n), abs(j - n))
			k.append(d + 1)
		print(*k)


n = int(input())
temp = [n for i in range(2 * n - 1)]
arr = []
firstelement = temp[:]
arr.append(firstelement)
for i in range(1, n):
	temp[i:-i] = [n - i for j in range(len(temp[i:-i]))]
	ttemp = temp[:]
	arr.append(ttemp)
for i in range(len(arr) - 2, 0, -1):
	appendtemp = arr[i][:]
	arr.append(appendtemp)
arr.append(arr[0])
for i in arr:
	for j in i:
		print(j, end=' ')
	print('\n')


n = int(input())
for i in range(2 * n - 1):
	a = n
	if i < n:
		for j in range(2 * n - 1):
			print(a, end=' ')
			if i > j:
				a = a - 1
			elif i + j >= 2 * n - 2:
				a = a + 1
	elif i >= n:
		for j in range(2 * n - 1):
			print(a, end=' ')
			if i + j < 2 * n - 2:
				a = a - 1
			elif j >= i:
				a = a + 1
	print()


n = int(input())
leng = 2 * n - 1
for row in range(0, leng):
	for col in range(0, leng):
		mini = row if row < col else col
		mini = mini if mini < leng - row else leng - row - 1
		mini = mini if mini < leng - col else leng - col - 1
		print(n - mini, end=' ')
	print('')


n = int(input())
le = 2 * n - 1
for i in range(le):
	for j in range(le):
		print(n - min(i, j, le - 1 - i, le - 1 - j), end=' ')
	print()


def replace(l, key, i, j):
	for k in range(i, j + 1):
		l[k] = str(key)
n = int(input())
s = str(n)
i = 0
j = n * 2 - 2
key = n
m = []
l = (n * 2 - 1) * s.split()
for i in range(int((n * 2 - 2) / 2) + 1):
	replace(l, key, i, j)
	key -= 1
	j -= 1
	m.append(' '.join(l))
for j in range(n - 2, -1, -1):
	m.append(m[j])
for p in m:
	print(p)


n = int(input())

def mini(a, b, n):
	if a < n and b < n:
		return min(a, b)
	elif a >= n and b < n:
		return min(2 * n - 2 - a, b)
	elif a < n and b >= n:
		return min(a, 2 * n - 2 - b)
	elif a >= n and b >= n:
		return min(2 * n - 2 - a, 2 * n - 2 - b)
for i in range(0, 2 * n - 1):
	for j in range(0, 2 * n - 1):
		temp = n - mini(i, j, n)
		print(temp, end=' ')
	print('')


from sys import stdin, stdout
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque
from heapq import merge, heapify, heappop, heappush, nsmallest
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def inp():
	return stdin.readline().strip()

def out(var, end='\n'):
	stdout.write(str(var) + '\n')

def outa(*var, end='\n'):
	stdout.write(' '.join(map(str, var)) + end)

def lmp():
	return list(mp())

def mp():
	return list(map(int, inp().split()))

def smp():
	return list(map(str, inp().split()))

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]

def remadd(x, y):
	return 1 if x % y else 0

def ceil(a, b):
	return (a + b - 1) // b

def isprime(x):
	if x <= 1:
		return False
	if x in (2, 3):
		return True
	if x % 2 == 0:
		return False
	for i in range(3, int(sqrt(x)) + 1, 2):
		if x % i == 0:
			return False
	return True
n = int(inp())
t = False
k = 0
ml = [str(n) for i in range(2 * n - 1)]
while k > 0 or not t:
	k += -1 if t else 1
	print(' '.join(ml))
	for i in range(k, 2 * n - 1 - k):
		ml[i] = str(n - k)
	if k == n - 1:
		t = True
print(' '.join(ml))


N = int(input())
for i in range(1, N + 1):
	for j in range(1, N + 1):
		min = i if i < j else j
		print(N - min + 1, end=' ')
	for j in range(N - 1, 0, -1):
		min = i if i < j else j
		print(N - min + 1, end=' ')
	print()
for i in range(N - 1, 0, -1):
	for j in range(1, N + 1):
		min = i if i < j else j
		print(N - min + 1, end=' ')
	for j in range(N - 1, 0, -1):
		min = i if i < j else j
		print(N - min + 1, end=' ')
	print()