#include <bits/stdc++.h>
#define ll long long

using namespace std;

string ans[10][10];

int main()
{
    ans[3][0] = "aab";
    ans[3][1] = "c.b";
    ans[3][2] = "cdd";

    ans[4][0] = "aacd";
    ans[4][1] = "bbcd";
    ans[4][2] = "cdaa";
    ans[4][3] = "cdbb";

    ans[5][0] = "aabbc";
    ans[5][1] = "d.ddc";
    ans[5][2] = "da..d";
    ans[5][3] = "ca..d";
    ans[5][4] = "cbbaa";

    ans[6][0] = "aabaa.";
    ans[6][1] = "c.b..c";
    ans[6][2] = "cdd..c";
    ans[6][3] = "aa.aab";
    ans[6][4] = "..bc.b";
    ans[6][5] = "..bcdd";

    ans[7][0] = "aabbcc.";
    ans[7][1] = "bb.aa.c";
    ans[7][2] = "..c..dc";
    ans[7][3] = "..c..db";
    ans[7][4] = "aa.bb.b";
    ans[7][5] = "..c..ca";
    ans[7][6] = "..c..ca";

    ans[8][0] = "aabbaa..";
    ans[8][1] = "bbaabb..";
    ans[8][2] = "aa....ab";
    ans[8][3] = "..b...ab";
    ans[8][4] = "..b...ba";
    ans[8][5] = "...aa.ba";
    ans[8][6] = ".....bab";
    ans[8][7] = ".....bab";

    ll n;
    cin >> n;
    if(n <= 2){
        cout << -1;
        return 0;
    }
    if(n < 9){
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++){
                cout << ans[n][i][j];
            }
            cout << endl;
        }
        return 0;
    }
    if(n % 6 == 0 || n % 6 == 3){
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++){
                if(i/3 == j/3){
                    cout << ans[3][i%3][j%3];
                }
                else{
                    cout << '.';
                }
            }
            cout << endl;
        }
        return 0;
    }
    if(n % 6 == 4){
        for(int i = 0; i < 4; i++){
            for(int j = 0; j < n; j++){
                if(j < 4){
                    cout << ans[4][i%4][j%4];
                }
                else{
                    cout << '.';
                }
            }
            cout << endl;
        }
        for(int i = 0; i < n-4; i++){
            for(int j = -4; j < n-4; j++){
                if(i/6 == j/6 && j >= 0){
                    cout << ans[6][i%6][j%6];
                }
                else{
                    cout << '.';
                }
            }
            cout << endl;
        }
        return 0;
    }
    if(n % 6 == 5){
        for(int i = 0; i < 5; i++){
            for(int j = 0; j < n; j++){
                if(j < 5){
                    cout << ans[5][i%5][j%5];
                }
                else{
                    cout << '.';
                }
            }
            cout << endl;
        }
        for(int i = 0; i < n-5; i++){
            for(int j = -5; j < n-5; j++){
                if(i/6 == j/6 && j >= 0){
                    cout << ans[6][i%6][j%6];
                }
                else{
                    cout << '.';
                }
            }
            cout << endl;
        }
        return 0;
    }
    if(n % 6 == 1){
        for(int i = 0; i < 7; i++){
            for(int j = 0; j < n; j++){
                if(j < 7){
                    cout << ans[7][i%7][j%7];
                }
                else{
                    cout << '.';
                }
            }
            cout << endl;
        }
        for(int i = 0; i < n-7; i++){
            for(int j = -7; j < n-7; j++){
                if(i/6 == j/6 && j >= 0){
                    cout << ans[6][i%6][j%6];
                }
                else{
                    cout << '.';
                }
            }
            cout << endl;
        }
        return 0;
    }
    if(n % 6 == 2){
        for(int i = 0; i < 8; i++){
            for(int j = 0; j < n; j++){
                if(j < 8){
                    cout << ans[8][i%8][j%8];
                }
                else{
                    cout << '.';
                }
            }
            cout << endl;
        }
        for(int i = 0; i < n-8; i++){
            for(int j = -8; j < n-8; j++){
                if(i/6 == j/6 && j >= 0){
                    cout << ans[6][i%6][j%6];
                }
                else{
                    cout << '.';
                }
            }
            cout << endl;
        }
        return 0;
    }
}


Measured memory_bytes: 1280