/*input
4
*/
//11 7
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int sz = 7;
char yra[sz][sz];
int kx[sz], ky[sz];
void ieskok(int i, int j)
{
	if (i >= sz)
	{
		i -= sz;
		j++;
	}
	if (j >= sz)
	{
		bool ok = true;
		for (int t = 0; t < sz; t++)
		{
			if (kx[t] != kx[0])
				ok = false;
			if (ky[t] != kx[0])
				ok = false;
		}
		if (ok)
		{
			for (int i = 0; i < sz; i++)
			{
				for (int j = 0; j < sz; j++)
				{
					cout << yra[i][j];
				}
				cout << "\n";
			}
			cout << endl;
		}
		return;
	}
	if (i != 0 && kx[i] > kx[0])
		return;
	char c = 'a' + (i + j);
	if (i + 1 < sz && j < sz && yra[i][j] == '.' && yra[i + 1][j] == '.')
	{
		yra[i][j] = yra[i + 1][j] = c;
		kx[i]++;
		kx[i + 1]++;
		ky[j]++;
		ieskok(i, j);
		kx[i]--;
		kx[i + 1]--;
		ky[j]--;
		yra[i][j] = yra[i + 1][j] = '.';
	}
	if (i < sz && j + 1 < sz && yra[i][j] == '.' && yra[i][j + 1] == '.')
	{
		yra[i][j] = yra[i][j + 1] = c;
		kx[i]++;
		ky[j]++;
		ky[j + 1]++;
		ieskok(i, j);
		kx[i]--;
		ky[j]--;
		ky[j + 1]--;
		yra[i][j] = yra[i][j + 1] = '.';
	}
	ieskok(i + 1, j);
}
int main()
{
	for (int i = 0; i < sz; i++)
	{
		for (int j = 0; j < sz; j++)
		{
			yra[i][j] = '.';
		}
	}
	//ieskok(0, 0);
	ios_base::sync_with_stdio(false);
	int n;
	cin >> n;
	if (n == 7)
	{
		cout << "abc....\n";
		cout << "abc....\n";
		cout << "cd.ff..\n";
		cout << "cd.gg..\n";
		cout << "eff..jj\n";
		cout << "e.h..kk\n";
		cout << "..hjjll\n";
		return 0;
	}
	if (n == 11)
	{
		cout << "abc........\n";
		cout << "abc........\n";
		cout << "cd.ff......\n";
		cout << "cd.gg......\n";
		cout << "eff..jj....\n";
		cout << "e.h..kk....\n";
		cout << "..hjjll....\n";
		cout << ".......abcc\n";
		cout << ".......abdd\n";
		cout << ".......ddab\n";
		cout << ".......ccab\n";
		return 0;
	}
	if (n % 3 == 0)
	{
		char A[n][n];
		for (int i = 0; i < n; i++)
		{
			for (int j = 0; j < n; j++)
			{
				A[i][j] = '.';
			}
		}
		for (int i = 0; i < n / 3; i++)
		{
			for (int j = 0; j < n / 3; j++)
			{
				if (i != j)
					continue;
				int x = i * 3;
				int y = j * 3;
				A[x][y] = 'a';
				A[x + 1][y] = 'a';
				A[x + 2][y] = 'b';
				A[x + 2][y + 1] = 'b';
				A[x][y + 1] = 'b';
				A[x][y + 2] = 'b';
				A[x + 1][y + 2] = 'a';
				A[x + 2][y + 2] = 'a';
			}
		}
		for (int i = 0; i < n; i++)
		{
			for (int j = 0; j < n; j++)
			{
				cout << A[i][j];
			}
			cout << "\n";
		}
		return 0;
	}

	if (n % 4 == 0)
	{
		char A[n][n];
		for (int i = 0; i < n; i++)
		{
			for (int j = 0; j < n; j++)
			{
				A[i][j] = '.';
			}
		}
		for (int i = 0; i < n / 4; i++)
		{
			for (int j = 0; j < n / 4; j++)
			{
				if (i != j)
					continue;
				int x = i * 4;
				int y = j * 4;
				A[x][y] = 'a';
				A[x + 1][y] = 'a';
				A[x][y + 1] = 'b';
				A[x + 1][y + 1] = 'b';
				A[x + 2][y + 1] = 'c';
				A[x + 2][y] = 'c';
				A[x + 3][y + 1] = 'd';
				A[x + 3][y] = 'd';
				A[x + 0][y + 3] = 'c';
				A[x + 0][y + 2] = 'c';
				A[x + 1][y + 3] = 'd';
				A[x + 1][y + 2] = 'd';
				A[x + 2][y + 2] = 'a';
				A[x + 3][y + 2] = 'a';
				A[x + 2][y + 3] = 'b';
				A[x + 3][y + 3] = 'b';
			}
		}
		for (int i = 0; i < n; i++)
		{
			for (int j = 0; j < n; j++)
			{
				cout << A[i][j];
			}
			cout << "\n";
		}
		return 0;
	}
	if (n % 5 == 0)
	{
		char A[n][n];
		for (int i = 0; i < n; i++)
		{
			for (int j = 0; j < n; j++)
			{
				A[i][j] = '.';
			}
		}
		for (int i = 0; i < n / 5; i++)
		{
			for (int j = 0; j < n / 5; j++)
			{
				if (i != j)
					continue;
				int x = i * 5;
				int y = j * 5;
				A[x][y] = 'a';
				A[x + 1][y] = 'a';
				A[x + 2][y] = 'c';
				A[x + 3][y] = 'c';
				A[x + 4][y] = 'e';
				A[x + 4][y + 1] = 'e';
				A[x + 4][y] = 'e';
				A[x + 4][y + 2] = 'f';
				A[x + 3][y + 2] = 'f';
				A[x + 4][y + 3] = 'h';
				A[x + 4][y + 4] = 'h';
				A[x + 3][y + 4] = 'g';
				A[x + 2][y + 4] = 'g';
				A[x + 1][y + 4] = 'e';
				A[x + 1][y + 3] = 'e';
				A[x + 0][y + 3] = 'c';
				A[x + 0][y + 2] = 'c';
				A[x + 0][y + 1] = 'b';
				A[x + 1][y + 1] = 'b';
				A[x + 2][y + 1] = 'd';
				A[x + 2][y + 2] = 'd';
			}
		}
		for (int i = 0; i < n; i++)
		{
			for (int j = 0; j < n; j++)
			{
				cout << A[i][j];
			}
			cout << "\n";
		}
		return 0;
	}
	for (int a = 1; a < 300; a++)
	{
		for (int b = 1; b < 300; b++)
		{
			if (a * 4 + b * 5 == n)
			{
				char A[n][n];
				for (int i = 0; i < n; i++)
				{
					for (int j = 0; j < n; j++)
					{
						A[i][j] = '.';
					}
				}
				for (int i = 0; i < a; i++)
				{
					int x = i * 4;
					int y = i * 4;
					A[x][y] = 'a';
					A[x + 1][y] = 'a';
					A[x][y + 1] = 'b';
					A[x + 1][y + 1] = 'b';
					A[x + 2][y + 1] = 'c';
					A[x + 2][y] = 'c';
					A[x + 3][y + 1] = 'd';
					A[x + 3][y] = 'd';
					A[x + 0][y + 3] = 'c';
					A[x + 0][y + 2] = 'c';
					A[x + 1][y + 3] = 'd';
					A[x + 1][y + 2] = 'd';
					A[x + 2][y + 2] = 'a';
					A[x + 3][y + 2] = 'a';
					A[x + 2][y + 3] = 'b';
					A[x + 3][y + 3] = 'b';
				}
				for (int i = 0; i < b; i++)
				{
					int x = i * 5 + a * 4;
					int y = i * 5 + a * 4;
					A[x][y] = 'a';
					A[x + 1][y] = 'a';
					A[x + 2][y] = 'c';
					A[x + 3][y] = 'c';
					A[x + 4][y] = 'e';
					A[x + 4][y + 1] = 'e';
					A[x + 4][y] = 'e';
					A[x + 4][y + 2] = 'f';
					A[x + 3][y + 2] = 'f';
					A[x + 4][y + 3] = 'h';
					A[x + 4][y + 4] = 'h';
					A[x + 3][y + 4] = 'g';
					A[x + 2][y + 4] = 'g';
					A[x + 1][y + 4] = 'e';
					A[x + 1][y + 3] = 'e';
					A[x + 0][y + 3] = 'c';
					A[x + 0][y + 2] = 'c';
					A[x + 0][y + 1] = 'b';
					A[x + 1][y + 1] = 'b';
					A[x + 2][y + 1] = 'd';
					A[x + 2][y + 2] = 'd';
				}
				for (int i = 0; i < n; i++)
				{
					for (int j = 0; j < n; j++)
					{
						cout << A[i][j];
					}
					cout << "\n";
				}
				return 0;
			}
		}
	}
	cout << "-1\n";
}

Measured memory_bytes: 2176