#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <iomanip>
#include <algorithm>
using namespace std;

        long long int p[1001][1001] = {};
        long long int ans[1001][1001] = {};

int main() {

    long long int n;
    cin >> n;

    if ( ( n % 3 ) == 0 ) {
        for ( long long int i = 0; i < n; i++ ) {
            for ( long long int j = 0; j < n; j++ ) {
                if ( i / 3 == j / 3 ) {
                    if ( ( i % 3 ) == 0 ) {
                        if ( ( j % 3 ) != 2 ) {
                            cout << "a";
                            continue;
                        }
                    }
                    if ( ( j % 3 ) == 2 ) {
                        if ( ( i % 3 ) != 0 ) {
                            cout << "a";
                            continue;
                        }
                    }
                }
                cout << ".";
            }
            cout << endl;
        }
        return 0;
    }

    if ( n == 4 ) {
        cout << "bbde" << endl;
        cout << "ccde" << endl;
        cout << "fghh" << endl;
        cout << "fgii" << endl;
        return 0;
    }
    if ( n == 5 ) {
        cout << "aabba" << endl;
        cout << "bcc.a" << endl;
        cout << "b..cb" << endl;
        cout << "a..cb" << endl;
        cout << "abbaa" << endl;
        return 0;
    }
    if ( n == 7 ) {
        cout << "p..aapp" << endl;
        cout << "pbb..b." << endl;
        cout << "a.xx.b." << endl;
        cout << "a...x.a" << endl;
        cout << ".b..x.a" << endl;
        cout << ".b..bbp" << endl;
        cout << "ppaa..p" << endl;
        return 0;
    }
    if ( n == 8 ) {
        cout << "aa...bba" << endl;
        cout << "b.xx...a" << endl;
        cout << "bx.yy..." << endl;
        cout << ".xy..y.." << endl;
        cout << "..y..yx." << endl;
        cout << "...yy.xb" << endl;
        cout << "a...xx.b" << endl;
        cout << "abb...aa" << endl;
        return 0;
    }
    if ( n == 10 ) {
        cout << "bbde......" << endl;
        cout << "ccde......" << endl;
        cout << "fghh......" << endl;
        cout << "fgii......" << endl;
        cout << "....aabpp." << endl;
        cout << "....b.b..q" << endl;
        cout << "....baa..q" << endl;
        cout << "....pp.aab" << endl;
        cout << "......qb.b" << endl;
        cout << "......qbaa" << endl;
        return 0;
    }
    if ( n == 11 ) {
        cout << "aabba......" << endl;
        cout << "bcc.a......" << endl;
        cout << "b..cb......" << endl;
        cout << "a..cb......" << endl;
        cout << "abbaa......" << endl;
        cout << ".....aabpp." << endl;
        cout << ".....b.b..q" << endl;
        cout << ".....baa..q" << endl;
        cout << ".....pp.aab" << endl;
        cout << ".......qb.b" << endl;
        cout << ".......qbaa" << endl;
        return 0;
    }
    if ( n == 14 ) {
        cout << "bbde.........." << endl;
        cout << "ccde.........." << endl;
        cout << "fghh.........." << endl;
        cout << "fgii.........." << endl;
        cout << "....bbde......" << endl;
        cout << "....ccde......" << endl;
        cout << "....fghh......" << endl;
        cout << "....fgii......" << endl;
        cout << "........aabpp." << endl;
        cout << "........b.b..q" << endl;
        cout << "........baa..q" << endl;
        cout << "........pp.aab" << endl;
        cout << "..........qb.b" << endl;
        cout << "..........qbaa" << endl;
        return 0;
    }

    if ( ( n % 3 ) == 1 && n >= 13 ) {
        ans[0][0] = 1;
        ans[0][1] = 1;
        ans[0][2] = 3;
        ans[0][3] = 4;
        ans[1][0] = 2;
        ans[1][1] = 2;
        ans[1][2] = 3;
        ans[1][3] = 4;
        ans[2][0] = 5;
        ans[2][1] = 6;
        ans[2][2] = 7;
        ans[2][3] = 7;
        ans[3][0] = 5;
        ans[3][1] = 6;
        ans[3][2] = 8;
        ans[3][3] = 8;
        long long int d = ( n - 4 ) / 3;
        p[d-1][0] = 1;
        p[0][d-1] = 1;
        for ( long long int i = 0; i < d; i++ ) {
            for ( long long int j = 0; j < d; j++ ) {
                if ( i == j ) p[i][j] = 1;
                if ( i == j - 1 ) p[i][j] = 1;
                if ( i == j + 1 ) p[i][j] = 1;
            }
        }
        for ( long long int i = 0; i < d; i++ ) {
            for ( long long int j = 0; j < d; j++ ) {
                if ( p[i][j] == 0 ) continue;
                ans[i*3+4][j*3+4] = 1;
                ans[i*3+4][j*3+5] = 1;
                ans[i*3+5][j*3+6] = 1;
                ans[i*3+6][j*3+6] = 1;
            }
        }
        for ( long long int i = 0; i < n; i++ ) {
            for ( long long int j = 0; j < n; j++ ) {
                if ( ans[i][j] > 0 ) {
                    char c = 'a' + ans[i][j];
                    cout << c;
                } else {
                    cout << ".";
                }
            }
            cout << endl;
        }
        return 0;
    }

    if ( ( n % 3 ) == 2 && n >= 17 ) {
        ans[0][0] = 1;
        ans[0][1] = 1;
        ans[0][2] = 3;
        ans[0][3] = 4;
        ans[1][0] = 2;
        ans[1][1] = 2;
        ans[1][2] = 3;
        ans[1][3] = 4;
        ans[2][0] = 5;
        ans[2][1] = 6;
        ans[2][2] = 7;
        ans[2][3] = 7;
        ans[3][0] = 5;
        ans[3][1] = 6;
        ans[3][2] = 8;
        ans[3][3] = 8;

        ans[4][4] = 1;
        ans[4][5] = 1;
        ans[4][6] = 3;
        ans[4][7] = 4;
        ans[5][4] = 2;
        ans[5][5] = 2;
        ans[5][6] = 3;
        ans[5][7] = 4;
        ans[6][4] = 5;
        ans[6][5] = 6;
        ans[6][6] = 7;
        ans[6][7] = 7;
        ans[7][4] = 5;
        ans[7][5] = 6;
        ans[7][6] = 8;
        ans[7][7] = 8;
        long long int d = ( n - 8 ) / 3;
        p[d-1][0] = 1;
        p[0][d-1] = 1;
        for ( long long int i = 0; i < d; i++ ) {
            for ( long long int j = 0; j < d; j++ ) {
                if ( i == j ) p[i][j] = 1;
                if ( i == j - 1 ) p[i][j] = 1;
                if ( i == j + 1 ) p[i][j] = 1;
            }
        }
        for ( long long int i = 0; i < d; i++ ) {
            for ( long long int j = 0; j < d; j++ ) {
                if ( p[i][j] == 0 ) continue;
                ans[i*3+ 8][j*3+ 8] = 1;
                ans[i*3+ 8][j*3+ 9] = 1;
                ans[i*3+ 9][j*3+10] = 1;
                ans[i*3+10][j*3+10] = 1;
            }
        }
        for ( long long int i = 0; i < n; i++ ) {
            for ( long long int j = 0; j < n; j++ ) {
                if ( ans[i][j] > 0 ) {
                    char c = 'a' + ans[i][j];
                    cout << c;
                } else {
                    cout << ".";
                }
            }
            cout << endl;
        }
        return 0;
    }

    cout << -1 << endl;
    return 0;

}


Measured memory_bytes: 12544