#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef double db;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vp;
const int inf = 1e9;
const ll INF = 1e18;
const db eps = 1e-10;

#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define ep emplace
#define mem(a) memset(a, 0, sizeof(a))
#define copy(a, b) memcpy(a, b, sizeof(b))
#define PA cout << "pass\n"
#define lowbit(x) (x & -x)
#define all(x) x.begin(), x.end()
#define TM cout << db(clock()) / CLOCKS_PER_SEC << '\n'

char s[1010][1010];
int n;

char t[10][10][10];

int main(){
    scanf("%d", &n);
    string tmp = " abcc";
    for(int i = 1; i <= 4; i++) t[4][1][i] = tmp[i];
    tmp = " abdd";
    for(int i = 1; i <= 4; i++) t[4][2][i] = tmp[i];
    tmp = " eegh";
    for(int i = 1; i <= 4; i++) t[4][3][i] = tmp[i];
    tmp = " ffgh";
    for(int i = 1; i <= 4; i++) t[4][4][i] = tmp[i];
    tmp = " aabbc";
    for(int i = 1; i <= 5; i++) t[5][1][i] = tmp[i];
    tmp = " dee.c";
    for(int i = 1; i <= 5; i++) t[5][2][i] = tmp[i];
    tmp = " d..fg";
    for(int i = 1; i <= 5; i++) t[5][3][i] = tmp[i];
    tmp = " h..fg";
    for(int i = 1; i <= 5; i++) t[5][4][i] = tmp[i];
    tmp = " hiijj";
    for(int i = 1; i <= 5; i++) t[5][5][i] = tmp[i];

    tmp = " aabc..";
    for(int i = 1; i <= 6; i++) t[6][1][i] = tmp[i];
    tmp = " ddbc..";
    for(int i = 1; i <= 6; i++) t[6][2][i] = tmp[i];
    tmp = " ..aabc";
    for(int i = 1; i <= 6; i++) t[6][3][i] = tmp[i];
    tmp = " ..ddbc";
    for(int i = 1; i <= 6; i++) t[6][4][i] = tmp[i];
    tmp = " bc..aa";
    for(int i = 1; i <= 6; i++) t[6][5][i] = tmp[i];
    tmp = " bc..dd";
    for(int i = 1; i <= 6; i++) t[6][6][i] = tmp[i];
    tmp = " aabbcc.";
    for(int i = 1; i <= 7; i++) t[7][1][i] = tmp[i];
    tmp = " dd.dd.a";
    for(int i = 1; i <= 7; i++) t[7][2][i] = tmp[i];
    tmp = " ..d..da";
    for(int i = 1; i <= 7; i++) t[7][3][i] = tmp[i];
    tmp = " ..d..db";
    for(int i = 1; i <= 7; i++) t[7][4][i] = tmp[i];
    tmp = " dd.dd.b";
    for(int i = 1; i <= 7; i++) t[7][5][i] = tmp[i];
    tmp = " ..d..dc";
    for(int i = 1; i <= 7; i++) t[7][6][i] = tmp[i];
    tmp = " ..d..dc";
    for(int i = 1; i <= 7; i++) t[7][7][i] = tmp[i];

    for(int i = 1, j = 1, k = 1; i <= 3 && j <= 3; k ^= 1){
        if(k) {
            t[3][i][j] = 'z';
            t[3][i][j + 1] = 'z';
            i += 1;
            j += 2;
        }
        else{
            t[3][i][j] = 'z';
            t[3][i + 1][j] = 'z';
            i += 2;
            j += 1;
        }
    }
    if(n == 2) puts("-1");
    else{
        if(n % 3 == 0){
            for(int i = 1, j = 1; i <= n && j <= n; i += 3, j += 3){
                for(int k = 0; k < 3; k++){
                    for(int p = 0; p < 3; p++){
                        s[i + k][j + p] = t[3][k + 1][p + 1];
                    }
                }
            }
        }
        else if(n == 5){
            for(int i = 1; i <= n; i++){
                for(int j = 1; j <= n; j++){
                    s[i][j] = t[5][i][j];
                }
            }
        }
        else if(n == 7){
            for(int i = 1; i <= n; i++){
                for(int j = 1; j <= n; j++){
                    s[i][j] = t[7][i][j];
                }
            }
        }
        else if(n % 2 == 0){
            if(n % 4 == 0){
                for(int i = 1, j = 1; i <= n && j <= n; i += 4, j += 4){
                    for(int k = 0; k < 4; k++){
                        for(int p = 0; p < 4; p++){
                            s[i + k][j + p] = t[4][k + 1][p + 1];
                        }
                    }
                }
            }
            else{
                for(int i = 1; i <= 6; i++){
                    for(int j = 1; j <= 6; j++){
                        s[i][j] = t[6][i][j];
                    }
                }
                for(int i = 7, j = 7; i <= n && j <= n; i += 4, j += 4){
                    for(int k = 0; k < 4; k++){
                        for(int p = 0; p < 4; p++){
                            s[i + k][j + p] = t[4][k + 1][p + 1];
                        }
                    }
                }
            }
        }
        else{
            if(n % 4 == 1){
                for(int i = 1; i <= 5; i++){
                    for(int j = 1; j <= 5; j++){
                        s[i][j] = t[5][i][j];
                    }
                }
            }
            else{
                for(int i = 1; i <= 7; i++){
                    for(int j = 1; j <= 7; j++){
                        s[i][j] = t[7][i][j];
                    }
                }
            }
            int tmp = n % 4 == 1 ? 6 : 8;
            for(int i = tmp, j = tmp; i <= n && j <= n; i += 4, j += 4){
                for(int k = 0; k < 4; k++){
                    for(int p = 0; p < 4; p++){
                        s[i + k][j + p] = t[4][k + 1][p + 1];
                    }
                }
            }
        }
        for(int i = 1; i <= n; i++){
            for(int j = 1; j <= n; j++){
                printf("%c", s[i][j] ? s[i][j] : '.');
            }
            puts("");
        }
    }
    return 0;
}

Measured memory_bytes: 2176