// #define DEBUGGING
#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) (V).begin(), (V).end()
#define ALLR(V) (V).rbegin(), (V).rend()
template <typename T> using V = std::vector<T>;
template <typename T> using VV = V<V<T>>;
using ll = std::int64_t;
using ull = std::uint64_t;
using PLL = std::pair<ll, ll>;
using TLL = std::tuple<ll, ll, ll>;
template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename T, typename... Tail> const T& var_min(const T &t, const Tail&... tail) { return std::min(t, var_min(tail...)); }
template <typename T, typename... Tail> const T& var_max(const T &t, const Tail&... tail) { return std::max(t, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }
template <typename T> const T& clamp(const T &t, const T &low, const T &high) { return std::max(low, std::min(high, t)); }
template <typename T> void chclamp(T &t, const T &low, const T &high) { return t = clamp(t, low, high); }
namespace init__ { struct InitIO { InitIO() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(30); } } init_io; }
#define mv_rec make_v(init, tail...)
template <typename T> T make_v(T init) { return init; }
template <typename T, typename... Tail> auto make_v(T init, size_t s, Tail... tail) { return V<decltype(mv_rec)>(s, mv_rec); }
#undef mv_rec
using namespace std;
#ifdef DEBUGGING
#include "../../debug/debug.cpp"
#else
#define DEBUG(...) 0
#define DEBUG_SEPARATOR_LINE 0
#endif

struct Solver {
    ll N;
    V<string> vs;
    V<ll> cnt_r, cnt_c;
    ll quol;

    Solver(ll N) : N(N), vs(N, string(N, '.')), cnt_r(N), cnt_c(N) { }

    bool set_f(ll i, ll j, bool tate, bool check_f = true) {
        if(tate && i + 1 == N) return false;
        if(!tate && j + 1 == N) return false;
        auto &a = vs[i][j];
        auto &b = (tate ? vs[i + 1][j] : vs[i][j + 1]);
        char c = (tate ? '^' : '<');
        char d = (tate ? 'v' : '>');
        if(a != '.' || b != '.') return false;
        a = c;
        b = d;
        ll cnt_max = 0;
        chmax(cnt_max, ++cnt_r[i]);
        chmax(cnt_max, ++cnt_c[j]);
        chmax(cnt_max, ++(tate ? cnt_r[i + 1] : cnt_c[j + 1]));
        if(check_f && quol < cnt_max) {
            unset_f(i, j);
            return false;
        }
        return true;
    }

    void unset_f(ll i, ll j) {
        if(vs[i][j] == '.') return;
        if(vs[i][j] == 'v') i--;
        if(vs[i][j] == '>') j--;
        cnt_r[i]--;
        cnt_c[j]--;
        if(vs[i][j] == '^') {
            cnt_r[i + 1]--;
            vs[i][j] = vs[i + 1][j] = '.';
        } else {
            cnt_c[j + 1]--;
            vs[i][j] = vs[i][j + 1] = '.';
        }
    }

    bool check() {
        for(ll i = 0; i < N; i++) if(cnt_r[i] != quol || cnt_c[i] != quol) return false;
        return true;
    }

    bool solve() {
        ll pow3 = 1;
        for(ll i = 0; i < N; i++) pow3 *= 3;
        V<bool> searched(pow3);
        for(ll i = 1; i < pow3; i++) {
            ll S = i;
            bool ok = true;
            if(searched[i]) continue;
            searched[i] = true;
            for(ll j = 0; j < N; j++) {
                ll mod = S % 3;
                if(mod == 0) {
                    if(vs[0][j] != '.') ok = false;
                } else if(mod == 1) {
                    ok &= set_f(0, j, true, false);
                } else {
                    if(vs[0][j] != '>') ok &= set_f(0, j, false, false);
                }
                S /= 3;
            }

            quol = cnt_r[0];

            {
                ll sum = quol * 2 * N;
                if(sum % 3) ok = false;
                ll need = sum / 3;
                if(N * N < need * 2) ok = false;
            }

            if(!ok) {
                for(ll j = 0; j < N; j++) unset_f(0, j);
                continue;
            }

            ok = search(1, 0);
            if(ok) break;
            for(ll j = 0; j < N; j++) unset_f(0, j);

        }
        return false;
    }

    bool search_nxt(ll i, ll j) {
        while(i + 1 < N || j + 1 < N) {
            if(i + 1 == N && j + 1 == N) break;
            if(j + 1 == N) {
                i++;
                j = 0;
            } else {
                j++;
            }
            if(vs[i][j] != '.') continue;
            return search(i, j);
        }
        return check();
    }

    bool search(ll i, ll j) {
        if(cnt_r[0] < max(cnt_r[i], cnt_c[j])) return false;
        if(vs[i][j] != '.') return search_nxt(i, j);

        if(search_nxt(i, j)) return true;

        if(set_f(i, j, true)) {
            if(search_nxt(i, j)) return true;
            unset_f(i, j);
        }

        if(set_f(i, j, false)) {
            if(search_nxt(i, j)) return true;
            unset_f(i, j);
        }

        return false;
    }
};

V<string> ans;

bool solve() {
    ll N;
    cin >> N;
    if(N == 2) return false;
    VV<string> vs(8);
    V<ll> pre_idx(1010, -1);
    ans = make_v<string>(string(N, '.'), N);
    {
        V<ll> idx = { 3, 4, 5, 7, };
        reverse(ALL(idx));
        for(ll e : idx) {
            Solver solver(e);
            solver.solve();
            vs[e] = solver.vs;
        }

        idx.pop_back();
        for(ll e : idx) pre_idx[e] = e;
        DEBUG(idx);

        DEBUG(vs);
        for(ll i = 8; i <= N; i++) {
            for(ll e : idx) {
                if(i < e) continue;
                if(pre_idx[i - e] != -1) {
                    pre_idx[i] = e;
                    break;
                }
            }
        }
    }

    pre_idx[3] = pre_idx[6] = 3;

    auto set_ans = [&](ll i, ll idx) {
        for(ll j = 0; j < idx; j++) for(ll k = 0; k < idx; k++) ans[i + j][i + k] = vs[idx][j][k];
    };

    ll cur = 0;
    ll rest = N;
    DEBUG(pre_idx);
    while(rest) {
        ll pidx = pre_idx[rest];
        rest -= pidx;
        set_ans(cur, pidx);
        cur += pidx;
    }

    return true;
}

int main() {
    if(solve()) {
        char c = 'a';
        for(ll i = 0; i < ans.size(); i++) for(ll j = 0; j < ans[i].size(); j++) {
            if(ans[i][j] == '^') ans[i][j] = ans[i + 1][j] = c;
            else if(ans[i][j] == '<') ans[i][j] = ans[i][j + 1] = c;
            else continue;
            if(c == 'z') c = 'a';
            else c++;
        }
        for(auto &&s : ans) cout << s << endl;
    } else {
        cout << -1 << endl;
    }
    return 0;
}


Measured memory_bytes: 2304