#include "bits/stdc++.h"
using namespace std;
typedef long long li;

int four[4][4] = {
        {0, 0, 1, 2},
        {3, 3, 1, 2},
        {4, 5, 6, 6},
        {4, 5, 7, 7}
};

int three1[3][3] = {
        { 0,  0, -1},
        {-1, -1,  0},
        {-1, -1,  0}
};

int three2[3][3] = {
        { 0,  0,  1},
        { 3, -1,  1},
        { 3,  2,  2}
};

int five[5][5] = {
        {0, 0, 1, 1, 0},
        {1, 2, 2,-1, 0},
        {1,-1,-1, 2, 1},
        {0,-1,-1, 2, 1},
        {0, 1, 1, 0, 0}
};

vector<string> ans;

void pfour(int x, int y, int coloffset) {
    for (int i = 0; i < 4; ++i) {
        for (int j = 0; j < 4; ++j) {
            int col = four[i][j];
            if (col != -1) {
                ans[x + i][y + j] = col + coloffset + 'a';
            }
        }
    }
}

void pthree1(int x, int y, int coloffset) {
    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 3; ++j) {
            int col = three1[i][j];
            if (col != -1) {
                ans[x + i][y + j] = col + coloffset + 'a';
            }
        }
    }
}

void pthree2(int x, int y, int coloffset) {
    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 3; ++j) {
            int col = three2[i][j];
            if (col != -1) {
                ans[x + i][y + j] = col + coloffset + 'a';
            }
        }
    }
}

void pfive(int x, int y, int coloffset) {
    for (int i = 0; i < 5; ++i) {
        for (int j = 0; j < 5; ++j) {
            int col = five[i][j];
            if (col != -1) {
                ans[x + i][y + j] = col + coloffset + 'a';
            }
        }
    }
}

void psix(int x, int y, int coloffset) {
    pthree1(x, y, coloffset);
    pthree2(x + 3, y, coloffset);
    pthree2(x, y + 3, coloffset);
    pthree1(x + 3, y + 3, coloffset);
}

void pseven(int x, int y) {
    pthree1(x, y, 0);
    pthree1(x + 3, y, 0);
    pthree1(x, y + 3, 0);
    pthree1(x + 3, y + 3, 0);
    for (int i = 0; i < 6; ++i) {
        int col = (i / 2) % 2 + 1;
        ans[x + 6][y + i] = col + 'a';
        ans[x + i][y + 6] = col + 'a';
    }
}

void pnine(int x, int y, int coloffset) {
    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 3; ++j) {
            pthree1(x + 3 * i, y + 3 * j, coloffset);
        }
    }
}

vector<li> decompose(li n) {
    vector<li> res;
    while (n > 0) {
        li sz;
        if (n >= 16) {
            sz = 4;
        } else if (n == 15) {
            sz = 9;
        } else if (n >= 12) {
            sz = 4;
        } else if (n == 11) {
            sz = 6;
        } else if (n == 10) {
            sz = 6;
        } else if (n == 9) {
            sz = 9;
        } else if (n == 8) {
            sz = 4;
        } else if (n == 7) {
            sz = 7;
        } else if (n == 6) {
            sz = 6;
        } else if (n == 5) {
            sz = 5;
        } else if (n == 4) {
            sz = 4;
        } else {
            sz = 111;
            cout << "invalid" << endl;
        }

        n -= sz;
        res.push_back(sz);
    }
    return res;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    li nn;
    cin >> nn;
    ans = vector<string>(nn, string(nn, '.'));
    if (nn <= 2) {
        cout << -1 << endl;
        return 0;
    } else if (nn == 3) {
        pthree1(0, 0, 0);
    } else if (nn == 4) {
        pfour(0, 0, 0);
    } else {
        auto components = decompose(nn);
        li offset = 0;
        for (int i = 0; i < components.size(); ++i) {
            int sz = components[i];
            if (sz == 4) {
                pfour(offset, offset, 0);
            } else if (sz == 5) {
                pfive(offset, offset, 0);
            } else if (sz == 6) {
                psix(offset, offset, 0);
            } else if (sz == 7) {
                pseven(offset, offset);
            } else {
                pnine(offset, offset, 0);
            }
            offset += sz;
        }
    }

    for (int i = 0; i < nn; ++i) {
        cout << ans[i] << '\n';
    }

    return 0;
}

Measured memory_bytes: 2304