#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
//#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;

int main() {
#ifdef DEBUG
    freopen("input.txt", "r", stdin);
#else
    //    freopen("zalupa.in","r",stdin);
    //    freopen("zalupa.out","w",stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << setprecision(20);
    cout << fixed;
    int n;
    vector<string> a3 =
        {
            "aab",
            "d.b",
            "dcc"
        };

    vector<string> a4 =
        {
            "aabc",
            "ddbc",
            "efgg",
            "efhh"
        };
    vector<string> a5 =
        {
            "aabxx}",
            "d.byy}",
            "dccww",
            "stw..",
            "stw.."
        };
    vector<string> a7 =
        {
            "..a..bc",
            "..a..bc",
            "..deeff",
            "..d.sll",
            "kkrrs..",
            "ll.pf..",
            "ww.pf..",
        };
    cin >> n;
    if (n == 2) {
        cout << "-1";
        return 0;
    }
    if (n % 3 == 0) {
        for (int i = 0; i < n / 3; i++) {
            for (int k = 0; k < 3; k++) {
                for (int j = 0; j < i; j++) {
                    cout << "...";
                }
                cout << a3[k];
                for (int j = i + 1; j < n / 3; j++) {
                    cout << "...";
                }
                cout << "\n";
            }
        }
        return 0;
    }
    if (n % 4 == 0) {
        for (int i = 0; i < n / 4; i++) {
            for (int k = 0; k < 4; k++) {
                for (int j = 0; j < i; j++) {
                    cout << "....";
                }
                cout << a4[k];
                for (int j = i + 1; j < n / 4; j++) {
                    cout << "....";
                }
                cout << "\n";
            }
        }
        return 0;
    }
    if (n % 4 == 1) {
        vector<vector<int>> g(n, vector<int>(n, '.'));
        for (int i = 0; i < 5; i++) {
            for (int j = 0; j < 5; j++) {
                g[i][j] = a5[i][j];
            }
        }
        for (int i = 5; i < n; i += 4) {
            for (int j = 0; j < 4; j++) {
                for (int k = 0; k < 4; k++) {
                    g[i + j][i + k] = a4[j][k];
                }
            }
        }
        for(int i=0;i<n;i++) {
            for(int j =0 ;j <n;j++ ) {
                cout << char(g[i][j]);
            }
            cout << '\n';
        }
        return 0;
    }
    if (n % 4 == 2) {
        vector<vector<int>> g(n, vector<int>(n, '.'));
        for (int i = 0; i < 5; i++) {
            for (int j = 0; j < 5; j++) {
                g[i][j] = a5[i][j];
            }
        }
        for (int i = 0; i < 5; i++) {
            for (int j = 0; j < 5; j++) {
                g[5 + i][5 + j] = a5[i][j];
            }
        }
        for (int i = 10; i < n; i += 4) {
            for (int j = 0; j < 4; j++) {
                for (int k = 0; k < 4; k++) {
                    g[i + j][i + k] = a4[j][k];
                }
            }
        }
        for(int i=0;i<n;i++) {
            for(int j =0 ;j <n;j++ ) {
                cout << char(g[i][j]);
            }
            cout << '\n';
        }
        return 0;
    }
    if (n%4 == 3) {
        vector<vector<int>> g(n, vector<int>(n, '.'));
        for (int i = 0; i < 7; i++) {
            for (int j = 0; j < 7; j++) {
                g[i][j] = a7[i][j];
            }
        }
        for (int i = 7; i < n; i += 4) {
            for (int j = 0; j < 4; j++) {
                for (int k = 0; k < 4; k++) {
                    g[i + j][i + k] = a4[j][k];
                }
            }
        }
        for(int i=0;i<n;i++) {
            for(int j =0 ;j <n;j++ ) {
                cout << char(g[i][j]);
            }
            cout << '\n';
        }
        return 0;
    }
    return 0;
}

Measured memory_bytes: 5120