#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;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aW9tYW5pcD4KI2luY2x1ZGUgPGNtYXRoPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNvbnN0IGludCBNQVhOID0gNDk7CgppbnQgYSBbTUFYTiArIDJdW01BWE4gKyAyXSA9IHswfTsKCmludCBtYWluICgpCnsKCWludCBuOwoJY2luID4+IG47CgkKCWlmICgobiAtIChuICogbiAvIDIpIC8gKG4gLSAxKSkgJSAyICE9IDApCgl7CgkJaW50IG9kZCA9IDEsIGV2ZW4gPSAyLCBjaGFuZ2UgPSAobiAvIDIpICogbiArIDE7CgkJZm9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