#include<bits/stdc++.h>
using ll = long long;
using namespace std;
const ll INF = 1000000000000000000;
const ll mod = 998244353;
//printf("%.10f\n", n);
char maze[1001][1001];
void yon(ll a) {
    maze[a + 1][a + 1] = 'a'; maze[a + 1][a + 2] = 'a'; maze[a + 1][a + 3] = 'b';
    maze[a + 1][a + 4] = 'd'; maze[a + 2][a + 1] = 'c'; maze[a + 2][a + 2] = 'c';
    maze[a + 2][a + 3] = 'b'; maze[a + 2][a + 4] = 'd'; maze[a + 3][a + 1] = 'b';
    maze[a + 3][a + 2] = 'd'; maze[a + 3][a + 3] = 'a'; maze[a + 3][a + 4] = 'a';
    maze[a + 4][a + 1] = 'b'; maze[a + 4][a + 2] = 'd'; maze[a + 4][a + 3] = 'c'; maze[a + 4][a + 4] = 'c';
}
void go(ll a) {
    maze[a + 1][a + 1] = 'a'; maze[a + 1][a + 2] = 'a'; maze[a + 1][a + 3] = 'b';
    maze[a + 1][a + 4] = 'b'; maze[a + 1][a + 5] = 'c'; maze[a + 2][a + 5] = 'c';
    maze[a + 2][a + 1] = 'd'; maze[a + 2][a + 2] = 'z'; maze[a + 2][a + 3] = 'z';
    maze[a + 3][a + 1] = 'd'; maze[a + 3][a + 4] = 'z'; maze[a + 3][a + 5] = 'd';
    maze[a + 4][a + 1] = 'e'; maze[a + 4][a + 4] = 'z'; maze[a + 4][a + 5] = 'd';
    maze[a + 5][a + 1] = 'e'; maze[a + 5][a + 2] = 'f'; maze[a + 5][a + 3] = 'f';
    maze[a + 5][a + 4] = 'e'; maze[a + 5][a + 5] = 'e';
}
void nana(ll a) {
    maze[a + 1][a + 1] = 'a'; maze[a + 1][a + 2] = 'a'; maze[a + 1][a + 4] = 'a'; maze[a + 1][a + 5] = 'a';
    maze[a + 1][a + 7] = 'a'; maze[a + 2][a + 7] = 'a'; maze[a + 3][a + 1] = 'a'; maze[a + 3][a + 3] = 'a';
    maze[a + 3][a + 4] = 'a'; maze[a + 4][a + 1] = 'a'; maze[a + 4][a + 5] = 'a'; maze[a + 4][a + 7] = 'a';
    maze[a + 5][a + 5] = 'a'; maze[a + 5][a + 7] = 'a'; maze[a + 6][a + 1] = 'a'; maze[a + 7][a + 1] = 'a';
    maze[a + 7][a + 3] = 'a'; maze[a + 7][a + 4] = 'a'; maze[a + 7][a + 6] = 'a'; maze[a + 7][a + 7] = 'a';
    maze[a + 2][a + 2] = 'z'; maze[a + 2][a + 5] = 'z'; maze[a + 2][a + 6] = 'z'; maze[a + 3][a + 2] = 'z';
    maze[a + 5][a + 6] = 'z'; maze[a + 6][a + 2] = 'z'; maze[a + 6][a + 3] = 'z'; maze[a + 6][a + 6] = 'z';
}
signed main() {
    ll n, m, a = 0; cin >> n;
    for (int h = 0; h < 1001; h++) {
        for (int i = 0; i < 1001; i++) {
            maze[h][i] = '.';
        }
    }
    if (n == 2) { cout << "-1" << endl; return 0; }
    if (n % 3 == 0) {
        while (true) {
            if (a == n) { break; }
            maze[a + 1][a + 1] = 'a'; maze[a + 1][a + 2] = 'a';
            maze[a + 2][a + 3] = 'a'; maze[a + 3][a + 3] = 'a';
            a += 3;
        }
    }
    else if (n % 5 == 0) {
        while (true) {
            if (a == n) { break; }
            go(a); a += 5;
        }
    }
    else if (n % 5 == 1) {
        while (true) {
            if (a == n - 11) { break; }
            go(a); a += 5;
        }
        yon(a); a += 4; nana(a);
    }
    else if (n % 5 == 2) {
        while (true) {
            if (a == n - 7) { break; }
            go(a); a += 5;
        }
        nana(a);
    }
    else if (n % 5 == 3) {
        while (true) {
            if (a == n - 8) { break; }
            go(a); a += 5;
        }
        yon(a); a += 4; yon(a);
    }
    else if (n % 5 == 4) {
        while (true) {
            if (a == n - 4) { break; }
            go(a); a += 5;
        }
        yon(a);
    }
    for (int h = 1; h <= n; h++) {
        for (int i = 1; i <= n; i++) {
            cout << maze[h][i];
        }
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 4648