Language: C++

int n;

int main() {
	cin >> n;
	if (n < 3)
		return cout << -1, 0;
	if (n == 3)
		return cout << "aa.\n..a\n..a", 0;
	for (int i = 0; i < n; i++)
		fill(c[i], c[i] + n, '.');
	for (int i = 0; i < n; i += 4)
		if (n - i == 5) {
			c[i][i] = c[i][i + 1] = 'a';
			c[i + 3][i] = c[i + 4][i] = 'a';
			c[i][i + 2] = c[i][i + 3] = 'b';
			c[i + 1][i] = c[i + 2][i] = 'b';
			c[i][i + 4] = c[i + 1][i + 4] = 'a';
			c[i + 4][i + 3] = c[i + 4][i + 4] = 'a';
			c[i + 2][i + 4] = c[i + 3][i + 4] = 'b';
			c[i + 4][i + 1] = c[i + 4][i + 2] = 'b';
			c[i + 1][i + 3] = c[i + 2][i + 3] = 'c';
			c[i + 3][i + 1] = c[i + 3][i + 2] = 'c';
			break;
		}
		else if (n - i == 6) {
			c[i][i] = c[i][i + 1] = 'b';
			c[i + 4][i] = c[i + 5][i] = 'd';
			c[i][i + 5] = c[i + 1][i + 5] = 'a';
			c[i + 1][i] = c[i + 1][i + 1] = 'c';
			c[i][i + 4] = c[i + 1][i + 4] = 'd';
			c[i + 2][i + 3] = c[i + 3][i + 3] = 'a';
			c[i + 4][i + 1] = c[i + 5][i + 1] = 'a';
			c[i + 2][i + 4] = c[i + 2][i + 5] = 'b';
			c[i + 4][i + 2] = c[i + 4][i + 3] = 'b';
			c[i + 3][i + 4] = c[i + 3][i + 5] = 'c';
			c[i + 5][i + 2] = c[i + 5][i + 3] = 'c';
			c[i + 2][i + 2] = c[i + 3][i + 2] = 'd';
		}
		else if (n - i == 7) {
			c[i][i + 6] = c[i + 1][i + 6] = 'a';
			c[i + 6][i] = c[i + 6][i + 1] = 'a';
			c[i][i + 2] = c[i + 1][i + 2] = 'd';
			c[i][i + 5] = c[i + 1][i + 5] = 'd';
			c[i + 2][i] = c[i + 2][i + 1] = 'd';
			c[i + 5][i] = c[i + 5][i + 1] = 'd';
			c[i + 2][i + 6] = c[i + 3][i + 6] = 'b';
			c[i + 6][i + 2] = c[i + 6][i + 3] = 'b';
			c[i + 4][i + 6] = c[i + 5][i + 6] = 'c';
			c[i + 6][i + 4] = c[i + 6][i + 5] = 'c';
			c[i + 2][i + 3] = c[i + 2][i + 4] = 'd';
			c[i + 3][i + 2] = c[i + 4][i + 2] = 'd';
			c[i + 3][i + 5] = c[i + 4][i + 5] = 'd';
			c[i + 5][i + 3] = c[i + 5][i + 4] = 'd';
		}
		else if (n - i > 3) {
			c[i][i] = c[i][i + 1] = 'b';
			c[i + 2][i] = c[i + 3][i] = 'd';
			c[i][i + 3] = c[i + 1][i + 3] = 'a';
			c[i + 1][i] = c[i + 1][i + 1] = 'c';
			c[i][i + 2] = c[i + 1][i + 2] = 'd';
			c[i + 2][i + 1] = c[i + 3][i + 1] = 'a';
			c[i + 2][i + 2] = c[i + 2][i + 3] = 'b';
			c[i + 3][i + 2] = c[i + 3][i + 3] = 'c';
		}
	for (int i = 0; i < n; i++)
		cout << c[i] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin >> n;
      |         ^~~
a.cc:6:24: error: 'cout' was not declared in this scope
    6 |                 return cout << -1, 0;
      |                        ^~~~
a.cc:8:24: error: 'cout' was not declared in this scope
    8 |                 return cout << "aa.\n..a\n..a", 0;
      |                        ^~~~
a.cc:10:22: error: 'c' was not declared in this scope
   10 |                 fill(c[i], c[i] + n, '.');
      |                      ^
a.cc:10:17: error: 'fill' was not declared in this scope
   10 |                 fill(c[i], c[i] + n, '.');
      |                 ^~~~
a.cc:13:25: error: 'c' was not declared in this scope
   13 |                         c[i][i] = c[i][i + 1] = 'a';
      |                         ^
a.cc:26:25: error: 'c' was not declared in this scope
   26 |                         c[i][i] = c[i][i + 1] = 'b';
      |                         ^
a.cc:40:25: error: 'c' was not declared in this scope
   40 |                         c[i][i + 6] = c[i + 1][i + 6] = 'a';
      |                         ^
a.cc:56:25: error: 'c' was not declared in this scope
   56 |                         c[i][i] = c[i][i + 1] = 'b';
      |                         ^
a.cc:66:17: error: 'cout' was not declared in this scope
   66 |                 cout << c[i] << endl;
      |                 ^~~~
a.cc:66:25: error: 'c' was not declared in this scope
   66 |                 cout << c[i] << endl;
      |                         ^
a.cc:66:33: error: 'endl' was not declared in this scope
   66 |                 cout << c[i] << endl;
      |                                 ^~~~