#include <bits/stdc++.h>

using namespace std;

const int max_n = 1011, inf = 1000111222;

int n, m, used[max_n][max_n], c[2][max_n];
int a[max_n][max_n], num;

void nxt(int &x, int &y) {
    ++y;
    if (y == m) {
        y = 0;
        ++x;
    }
}

void dfs(int x, int y) {
    nxt(x, y);
    if (x == n) {
        bool ok = true;
        for (int i = 0; i < n; ++i) {
            if (c[0][i] != c[0][0]) {
                ok = false;
            }
        }
        for (int i = 0; i < m; ++i) {
            if (c[1][i] != c[0][0]) {
                ok = false;
            }
        }
        if (ok && c[0][0]) {
            //cout << c[0][0] << ": " << endl;
            for (int i = 0; i < n; ++i) {
                for (int j = 0; j < m; ++j) {
                    if (a[i][j]) {
                        cout << (char) ('a' + a[i][j]);
                    } else {
                        cout << ".";
                    }
                }
                cout << endl;
            }
            cout << endl;
            exit(0);
        }
        return;
    }
    if (x && c[0][x - 1] != c[0][0]) {
        return;
    }
    if (y + 1 < m && !used[x][y] && !used[x][y + 1]) {
        ++num;
        ++used[x][y];
        ++used[x][y + 1];
        a[x][y] = num;
        a[x][y + 1] = num;
        ++c[0][x];
        ++c[1][y];
        ++c[1][y + 1];

        dfs(x, y);

        --num;
        a[x][y] = 0;
        a[x][y + 1] = 0;

        --used[x][y];
        --used[x][y + 1];
        --c[0][x];
        --c[1][y];
        --c[1][y + 1];
    }
    if (x + 1 < n && !used[x][y] && !used[x + 1][y]) {
        ++num;
        a[x][y] = num;
        a[x + 1][y] = num;
        ++used[x][y];
        ++used[x + 1][y];
        ++c[0][x];
        ++c[0][x + 1];
        ++c[1][y];

        dfs(x, y);

        --num;
        a[x][y] = 0;
        a[x + 1][y] = 0;

        --used[x][y];
        --used[x + 1][y];
        --c[0][x];
        --c[0][x + 1];
        --c[1][y];
    }
    dfs(x, y);
}

char ans[max_n][max_n];
vector<string> v4{
"abcc",
"abdd",
"eefg",
"hhfg",
};

vector<string> v5{
"bbccd",
"eef.d",
"ggfhh",
"..ijk",
"..ijk",
};

vector<string> v6{"bbccdd",
"eeffgg",
"hij...",
"hij...",
"...klm",
"...klm"};

void fil(int pos, const vector<string> &v) {
    //cout << "!" << pos << " " << v.size() << endl;
    for (int i = 0; i < v.size(); ++i) {
        for (int j = 0; j < v[i].size(); ++j) {
            ans[pos + i][pos + j] = v[i][j];
        }
    }
}

void write() {
    for (int i = 0; i < n; ++i) {
        puts(ans[i]);
    }
    exit(0);
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            ans[i][j] = '.';
        }
    }
    for (int c4 = 0; c4 * 4 <= n; ++c4) {
        int c5 = (n - c4 * 4) / 5;
        if (c4 * 4 + c5 * 5 == n) {
            for (int i = 0; i < c4; ++i) {
                fil(4 * i, v4);
            }
            for (int i = 0; i < c5; ++i) {
                fil(4 * c4 + 5 * i, v5);
            }
            write();
        }
    }
    if (n == 7) {
        puts("bbccdd.");
        puts("eeffg..");
        puts("hh..gii");
        puts("..jk..l");
        puts("..jk..l");
        puts("....mno");
        puts("....mno");
        return 0;
    }
    if (n == 11) {
        fil(0, v5);
        fil(5, v6);
        write();
    }
    m = n;
    dfs(0, -1);
    puts("-1");
    return 0;
}


Measured memory_bytes: 2304