#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < b; ++i)

int a[1010][1010];

void addBal2(int i, int j, int Let) {
    a[i][j] = a[i + 1][j] = Let;
    a[i + 2][j] = a[i + 2][j + 1] = Let + 1;
    a[i][j + 1] = a[i][j + 2] = Let + 2;
    a[i + 1][j + 2] = a[i + 2][j + 2] = Let + 3;
}

void addBal1(int i, int j, int Let) {
    a[i][j] = a[i + 1][j] = Let;
    a[i + 2][j + 1] = a[i + 2][j + 2] = Let + 1;
}

main() {
    int n;
    cin >> n;
    rep(i, 0, n) {
        fill(a[i], a[i] + n, -1);
    }
    if (n == 2){
        puts("-1");
        return 0;
    }
    if (n % 3 == 0) {
        rep(i, 0, n / 3) {
            int k = 3*i;
            a[k][k] = 1;
            a[k+1][k] = 1;
            a[k+2][k+1] = 1;
            a[k+2][k+2] = 1;
        }
    } else if (n % 2 == 0 && n >= 4) {
        rep(i, 0, n / 2) {
            int k = 2 * i;
            a[k][k] = a[k + 1][k] = 0;
            a[k][k + 1] = a[k + 1][k + 1] = 1;
            a[k][(k+2)%n] = a[k][(k+3)%n] = 2;
            a[k+1][(k+2)%n] = a[k+1][(k+3)%n] = 3;
        }
    } else if (n == 5) {
        a[0][0] = a[1][0] = 0;
        a[2][0] = a[3][0] = 1;
        a[4][0] = a[4][1] = 2;
        a[4][2] = a[4][3] = 3;
        a[4][4] = a[3][4] = 4;
        a[2][4] = a[1][4] = 5;
        a[0][1] = a[0][2] = 6;
        a[0][3] = a[0][4] = 7;
        a[1][1] = a[1][2] = 8;
        a[2][3] = a[3][3] = 9;
    } else if (n == 11) {
        a[0][0] = a[1][0] = 0;
        a[2][0] = a[3][0] = 1;
        a[4][0] = a[4][1] = 2;
        a[4][2] = a[4][3] = 3;
        a[4][4] = a[3][4] = 4;
        a[2][4] = a[1][4] = 5;
        a[0][1] = a[0][2] = 6;
        a[0][3] = a[0][4] = 7;
        a[1][1] = a[1][2] = 8;
        a[2][3] = a[3][3] = 9;
        addBal2(5, 5, 0);
        addBal2(8, 8, 4);
        addBal1(8, 5, 8);
        addBal1(5, 8, 10);
    } else if (n == 7) {
        a[2][0] = a[2][1] = 0;
        a[3][0] = a[3][1] = 1;
        a[4][0] = a[4][1] = 2;
        a[2][5] = a[2][6] = 3;
        a[3][5] = a[3][6] = 4;
        a[4][5] = a[4][6] = 5;
        a[0][2] = a[1][2] = 6;
        a[0][3] = a[1][3] = 7;
        a[0][4] = a[1][4] = 8;
        a[5][2] = a[6][2] = 9;
        a[5][3] = a[6][3] = 10;
        a[5][4] = a[6][4] = 11;
        a[2][2] = a[2][3] = 12;
        a[3][4] = a[4][4] = 13;
    } else {
        int x = 0, flag = 0;
        while (1) {
            if ((n - 9*x >= 4) && (n - 9*x) % 2 == 0) {
                flag = 1;
                break;
            }
            if (n - 9*x < 4) break;
            x++;
        }
        int n1 = n - 9 * x;
        rep(i, 0, n1 / 2) {
            int k = 2 * i;
            a[k][k] = a[k + 1][k] = 0;
            a[k][k + 1] = a[k + 1][k + 1] = 1;
            a[k][(k+2)%n1] = a[k][(k+3)%n1] = 2;
            a[k+1][(k+2)%n1] = a[k+1][(k+3)%n1] = 3;
        }
        rep(i, 0, x) {
            int k = n1 + 9 * i;
            addBal2(k, k, 0);
            addBal2(k + 3, k + 3, 4);
            addBal2(k + 6, k + 6, 8);
            addBal1(k + 6, k, 12);
            addBal1(k, k + 3, 14);
            addBal1(k + 3, k + 6, 16);
        }
    }
    rep(i, 0, n) {
        rep(j, 0, n) {
            cout << (a[i][j] != -1 ? char('a' + a[i][j]) : '.');
        }
        cout << '\n';
    }
}

Measured memory_bytes: 5120