#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define yn {puts("Yes");}else{puts("No");}
#define MAX_N 200005;

char c[1100][1100];

int main() {
    int n;
    cin >> n;

    if(n == 2){
        cout << "-1" << endl;
        return 0;
    }

    if(n == 4){
        string cc = "xxzwyyzwzwxxzwyy";
        rep(i,16){
            cout << cc[i];
            if(i % 4 == 3)cout << endl;
        }
        return 0;
    }

    int dx[9] = {0,0,0,1,1,1,2,2,2};
    int dy[9] = {0,1,2,0,1,2,0,1,2};
    string t = "e..e...ff";
    string s = "aabc.bcdd";

    rep(i,n){
        rep(j,n){
            c[i][j] = '.';
        }
    }

    if(n % 3 == 0){
        rep(i,n){
            rep(j,n){
                if(i%3 == 0 && j%3 == 0)c[i][j] = 'a';
                if(i%3 == 0 && j%3 == 1)c[i][j] = '.';
                if(i%3 == 0 && j%3 == 2)c[i][j] = '.';
                if(i%3 == 1 && j%3 == 0)c[i][j] = 'a';
                if(i%3 == 1 && j%3 == 1)c[i][j] = '.';
                if(i%3 == 1 && j%3 == 2)c[i][j] = '.';
                if(i%3 == 2 && j%3 == 0)c[i][j] = '.';
                if(i%3 == 2 && j%3 == 1)c[i][j] = 'b';
                if(i%3 == 2 && j%3 == 2)c[i][j] = 'b';
            }
        }
        
    }else if(n % 6 == 1){
        n--;
        rep(i,(n)/3){
            if(i < (n)/2 - (n)/3 - 1){
                rep(j,9){
                    c[dx[j]][i*3+dy[j]] = s[j];
                }
            }else{
                rep(j,9){
                    c[dx[j]][i*3+dy[j]] = t[j];
                }
            }
        }
        srep(i,1,n/3){
            rep(j,n/3){
                rep(k,9){
                    c[i*3+dx[k]][j*3+dy[k]] = c[(i-1)*3+dx[k]][(j*3+n-3+dy[k])%n];
                }
            }
        }

        n++;
        int cnt = 0;
        rep(i,n-1){
            if(cnt % 4 <= 1){
                c[i][n-1] = 'x';
            }else{
                c[i][n-1] = 'y';
            }
            cnt++;
        }
        rep(j,n-1){
            if(cnt % 4 <= 1){
                c[n-1][j] = 'z';
            }else{
                c[n-1][j] = 'w';
            }
            cnt++;
        }
        c[n-1][n-1] = '.';
    }else if(n % 6 == 2){
        n -= 2;
        rep(i,(n)/3){
            if(i < (n)/2 - (n)/3 - 2){
                rep(j,9){
                    c[dx[j]][i*3+dy[j]] = s[j];
                }
            }else{
                rep(j,9){
                    c[dx[j]][i*3+dy[j]] = t[j];
                }
            }
        }
        srep(i,1,n/3){
            rep(j,n/3){
                rep(k,9){
                    c[i*3+dx[k]][j*3+dy[k]] = c[(i-1)*3+dx[k]][(j*3+n-3+dy[k])%n];
                }
            }
        }

        int cnt = 0;

        
        
        rep(i,n){
            if(cnt % 4 <= 1){
                c[i][n] = 'g';
                c[i][n+1] = 'h';
            }else{
                c[i][n] = 'h';
                c[i][n+1] = 'g';
            }
            cnt++;
        }
        cnt = 0;
        rep(j,n){
            if(cnt % 4 <= 1){
                c[n][j] = 'i';
                c[n+1][j] = 'j';
            }else{
                c[n][j] = 'j';
                c[n+1][j] = 'i';
            }
            cnt++;
        }
        if(n == 6){
            c[0][0] = '.';
            c[1][0] = '.';
            c[2][1] = '.';
            c[2][2] = '.';
            c[3][3] = '.';
            c[4][3] = '.';
            c[5][4] = '.';
            c[5][5] = '.';
            
        }
        
        n += 2;
    }else if(n % 6 == 3){
        ;
    }else if(n % 6 == 4){
        n -= 4;
        rep(i,(n)/3){
            if(i < (n)/2 - (n)/3 - 1){
                rep(j,9){
                    c[dx[j]][i*3+dy[j]] = s[j];
                }
            }else{
                rep(j,9){
                    c[dx[j]][i*3+dy[j]] = t[j];
                }
            }
        }
        srep(i,1,n/3){
            rep(j,n/3){
                rep(k,9){
                    c[i*3+dx[k]][j*3+dy[k]] = c[(i-1)*3+dx[k]][(j*3+n-3+dy[k])%n];
                }
            }
        }
        int cnt = 0;
        rep(i,n){
            if(cnt % 4 <= 1){
                c[i][n] = 'g';
                c[i][n+1] = 'h';
                c[i][n+2] = 'g';
                c[i][n+3] = 'h';
            }else{
                c[i][n] = 'i';
                c[i][n+1] = 'j';
                c[i][n+2] = 'i';
                c[i][n+3] = 'j';
            }
            cnt++;
        }
        rep(j,n){
            if(cnt % 4 <= 1){
                c[n][j] = 'g';
                c[n+1][j] = 'h';
                c[n+2][j] = 'g';
                c[n+3][j] = 'h';
            }else{
                c[n][j] = 'i';
                c[n+1][j] = 'j';
                c[n+2][j] = 'i';
                c[n+3][j] = 'j';
            }
            cnt++;
        }
        string cc = "xxzwyyzwzwxxzwyy";
        rep(i,4){
            rep(j,4){
                c[n+i][n+j] = cc[i*4+j];
            }
        }
        n += 4;
    }else if(n % 6 == 5){
        n -= 2;
        rep(i,(n)/3){
            if(i < (n+3)/2 - 2 - (n)/3){
                rep(j,9){
                    c[dx[j]][i*3+dy[j]] = s[j];
                }
            }else{
                rep(j,9){
                    c[dx[j]][i*3+dy[j]] = t[j];
                }
            }
        }
        srep(i,1,n/3){
            rep(j,n/3){
                rep(k,9){
                    c[i*3+dx[k]][j*3+dy[k]] = c[(i-1)*3+dx[k]][(j*3+n-3+dy[k])%n];
                }
            }
        }
        rep(j,n+2){
            if(j == n + 1){
                cout << 'i';
            }
            else if(j % 4 <= 1){
                cout << 'g';
            }else{
                cout << 'h';
            }
        }
        cout << endl;

        rep(i,n){
           if(i % 4 <= 1){
                cout << 'i';
            }else{
                cout << 'j';
            }
            rep(j,n){
                cout << c[i][j];
            } 
            if((i+1) % 4 <= 1){
                cout << 'i';
            }else{
                cout << 'j';
            }
            cout << endl;
        }

        if((n+1) / 2 % 2 == 1){
            cout << 'i';
        } else{
            cout << 'j';
        }
        rep(i,n+1){
            if(i % 4 <= 1){
                cout << 'g';
            }else{
                cout << 'h';
            }
        }
        return 0;
    }

    rep(i,n){
        rep(j,n)cout << c[i][j];
        cout << endl;
    }

    return 0;
}
 
 


Measured memory_bytes: 2304