#include <bits/stdc++.h>

 

#define pb push_back

#define mp make_pair

#define fs first

#define sc second

#define rep(i, from, to) for (int i = from; i < (to); ++i)

#define all(x) x.begin(), x.end()

#define sz(x) (int) (x).size()

#define FOR(i, to) for (int i = 0; i < (to); ++i)

 

using namespace std;

typedef long long ll;

typedef vector<int> vi;

typedef pair<int,int> pii;

typedef pair<double,double> pdd;

typedef vector<ll> vll;

typedef vector<pair<int,int>> vpi;

typedef pair<ll,ll> pll;

typedef vector<string> vs;

#define MOD 1000000007

#define Nmax 402020

#define INF 101010LL * 101010LL

ll N,M,V,P;
vll v;
ll sm[Nmax];

int rmat[1010][1010];
int cmat[1010][1010];

int cur = 0;

void do_four(int N) {
  for(int i=0;i<N;i+=2) {
    for(int j=0;j<N;j+=2) {
      if( (i + j) % 4 == 0) {
        rmat[i][j] = ++cur;
        rmat[i][j+1] = cur;
        
        rmat[i+1][j] = ++cur;
        rmat[i+1][j+1] = cur;
      } else {
        rmat[i][j] = ++cur;
        rmat[i+1][j] = cur;
        
        rmat[i][j+1] = ++cur;
        rmat[i+1][j+1] = cur;
      }
    }
  }
}

void do_3(int N) {
  int pos = 0;
  while(pos < N) {
    int i = pos;
    rmat[i][i]=++cur;
    rmat[i][i+1]=cur;
    rmat[i+1][i+2]=++cur;
    rmat[i+2][i+2]=cur;
    pos += 3;
  }
  /*FOR(i, N) {
    FOR(j, N) {
      cout << rmat[i][j];
    }
    cout << endl;
  }*/
}

void make(int i,int j, int p) {
  if(p == 1) {
    rmat[i][j]=++cur;
    rmat[i][j+1]=cur;
    rmat[i+1][j+2]=++cur;
    rmat[i+2][j+2]=cur;  
  } else {
    rmat[i][j]=++cur;
    rmat[i][j+1]=cur;

    rmat[i][j+2]=++cur;
    rmat[i+1][j+2]=cur;
    
    rmat[i+2][j+2]=++cur;
    rmat[i+2][j+1]=cur;
    
    rmat[i+2][j]=++cur;
    rmat[i+1][j]=cur;  
    
  }
}

void solve(int x,int y) {
  int nrmat = x / 3;
  int nr2 = y - nrmat;
  
  for(int i=0;i<x;i+=3) {
    for(int j=0;j<x;j+=3) {
      if( ((i/3) + (j/3)) % nrmat < nr2) {
        make(i,j,2);
      } else {
        make(i,j,1);
      }
    }
  }
}
vector<char> rez[2020];

int dx[4] = {-1,1,0,0};
int dy[4] = {0,0,-1,1};

int ok(int x,int y) {
  if(x >= N || y >= N || x < 0 || y < 0) return 0;
  return 1;
}

int ispo(int i,int j, char c) {
  for(int k=0;k<4;++k) {
    if(ok(i+dx[k],j+dy[k]) && rez[i+dx[k]][j+dy[k]] == c) {
      return 0;
    }
  }
  return 1;
        
}

void afis() {
  FOR(i, N) {
    rez[i].resize(N);
  }
  FOR(i, N) {
    FOR(j, N) {
      if(rez[i][j] != 0) continue;
      if(cmat[i][j] != 0) {
        int ni,nj;
        for(int k=0;k<4;++k) {
          if(ok(i+dx[k],j+dy[k]) && cmat[i+dx[k]][j+dy[k]] == cmat[i][j]) {
            ni = i+dx[k];
            nj = j+dy[k];
          }
        }
        for(char c = 'a'; c <= 'z';++c) {
          if(ispo(i,j,c) && ispo(ni,nj,c)) {
            rez[i][j] = c;
            rez[ni][nj] = c;
            break;
          }
        }
      } else {
        rez[i][j] = '.';
      }
    }
  }
  FOR(i, N) {
    FOR(j, N) {
      cout << rez[i][j];
    }
    cout << "\n";
  }
}


int main() {

  cin.sync_with_stdio(false);
 

  cin >> N;
  if (N <= 2 ) {
    cout << -1;
    return 0;
  }
  if(N == 5) {
    cout << "aabba\n";
    cout << "bc..a\n";
    cout << "bc..b\n";
    cout << "a.ccb\n";
    cout << "abbaa\n";
    return 0;
  }
  int p = N;
  for(int i=3;i<=N;++i) {
    if(N % i == 0) {
      p = i;
      break;
    }
  }
  int cat = N / p;
  if(p == 4) {
    //cout << "WTF" << endl;
    do_four(N);
    FOR(i, N) {
      FOR(j, N) {
        cmat[i][j] = rmat[i][j];
      }
    }
  } else {
    if(p == 3) {
      do_3(N);
      FOR(i, N) {
        FOR(j, N) {
          cmat[i][j] = rmat[i][j];
        }
      }
    }
    if(p % 6 == 1) {
      solve(p-1,p/2 - 1);
      FOR(i, p) {
        FOR(j, p) {
          cmat[i][j] = rmat[i][j];
        }
      }
      for(int i=0;i<p-2;i+=2) {
       
       // cout << N-1 << " " << i << " " << cur << endl;
        cmat[p-1][i] = ++cur;
        cmat[p-1][i+1] = cur;

        cmat[i][p-1] = ++cur;
        cmat[i+1][p-1] = cur;
      }
      FOR(i, N) {
        FOR(j, N) {
          cmat[i][j] = cmat[i%p][j%p];
        }
      }
    }
    if(p % 6 == 5) {
      solve(p-2,p/2 - 1);
      FOR(i, p) {
        FOR(j, p) {
          cmat[i+1][j+1] = rmat[i][j];
        }
      }
      for(int i=0;i<p-1;i+=2) {
        cmat[p-1][i+2] = ++cur;
        cmat[p-1][i+1] = cur;

        cmat[i][p-1] = ++cur;
        cmat[i+1][p-1] = cur;

        cmat[0][i] = ++cur;
        cmat[0][i+1] = cur;

        cmat[i+2][0] = ++cur;
        cmat[i+1][0] = cur;
      }
      FOR(i, N) {
        FOR(j, N) {
          cmat[i][j] = cmat[i%p][j%p];
          //cout << cmat[i][j] << " ";
        }
        //cout << endl;
      }
    }
  }

  afis();

  

}

 

Measured memory_bytes: 10368