#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

const int MAXN = 49;

int a [MAXN + 2][MAXN + 2] = {0};

int main ()
{
	int n;
	cin >> n;
	
	if ((n - (n * n / 2) / (n - 1)) % 2 != 0)
	{
		int odd = 1, even = 2, change = (n / 2) * n + 1;
		for (int i = 1; i <= n; i++)
		{
			if (i == n / 2 + 1)
			{
				for (int j = 1; j <= n; j++)
				{
					a [i][j] = odd;
					odd += 2;
				}
			}
			else
			{
				for (int j = 1; j <= n; j++)
				{
					if (j % 2 != 0)
					{
						a [i][j] = even;
						even += 2;
					}
					else
					{
						a [i][j] = odd;
						odd += 2;
					}
				}
			}
		}
	}
	else
	{
		int even = 2, odd = 1, start = n / 2 + 2, end = n / 2;
		for (int i = 1; i <= n; i++)
		{
			a [i][i] = odd;
			odd += 2;
		}
		
		for (int i = 1; i <= end; i++)
		{
			for (int j = start; j <= n; j++)
			{
				a [i][j] = odd;
				odd += 2;
			}
		}
		for (int i = start; i <= n; i++)
		{
			for (int j = 1; j <= end; j++)
			{
				a [i][j] = odd;
				odd += 2;
			}
		}
		for (int i = 1; i <= n; i++)
		{
			for (int j = 1; j <= n; j++)
			{
				if (a [i][j] == 0)
				{
					a [i][j] = even;
					even += 2;
				}
			}
		}
	}
	
	int width = (int) log ((double) n * n) / log (10.0) + 1;
	//cout << width << "\n";
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= n; j++)
			cout << setw (width) << a [i][j] << " ";
		cout << "\n";
	}
	
	return 0;
}