#include<bits/stdc++.h>
using namespace std;




int main() {
  
  long long N;
  cin >> N;
  long long Nloop,Qua;
  
  
  
  if (N == 2) {
    cout << -1 << endl;
    return 0;
  }
  
  for (int i=3; i<1000; i++) {
    if (i >= 6 && i % 2 == 0) continue;
    if (N % i == 0) {
      Nloop = i;
      break;
    }
  }
  
  vector<vector<long long>> ans(N,vector<long long> (N,-1)), term(Nloop,vector<long long> (Nloop,-1));
  
  long long odd,sq,pl,plc,jc;
  
  if (Nloop == 3) {
    term[0][0] = 1;
    term[1][0] = 1;
    term[2][1] = 2;
    term[2][2] = 2;
  }
  else if (Nloop == 4) {
    term[0] = {1,1,2,3};
    term[1] = {4,4,2,3};
    term[2] = {5,8,6,6};
    term[3] = {5,8,7,7};
  }
  else if (Nloop %3 == 1) {
    Qua = Nloop / 2;
    sq = Nloop / 3;
    pl = Qua - sq - 1;
    odd = 0;
    for (int j=0; j<Nloop-2; j+=2) {
      term[Nloop-1][j] = 9+odd;
      term[Nloop-1][j+1] = 9+odd;
      term[j][Nloop-1] = 9+odd;
      term[j+1][Nloop-1] = 9+odd;
      odd = (odd + 1) % 2;
    }
    for (int i=0; i<sq; i++) {
      plc = pl;
      for (int j=i; j<sq+i; j++) {
        jc = j % sq;
        if (plc > 0) {
          term[i*3][jc*3] = 1 + 4 * ((i+jc)%2);
          term[i*3][jc*3+1] = 1 + 4 * ((i+jc)%2);
          term[i*3][jc*3+2] = 2 + 4 * ((i+jc)%2);
          term[i*3+1][jc*3+2] = 2 + 4 * ((i+jc)%2);
          term[i*3+1][jc*3] = 3 + 4 * ((i+jc)%2);
          term[i*3+2][jc*3] = 3 + 4 * ((i+jc)%2);
          term[i*3+2][jc*3+1] = 4 + 4 * ((i+jc)%2);
          term[i*3+2][jc*3+2] = 4 + 4 * ((i+jc)%2);
          plc--;
        }
        else {
          term[i*3][jc*3] = 1 + 4 * ((i+jc)%2);
          term[i*3+1][jc*3] = 1 + 4 * ((i+jc)%2);
          term[i*3+2][jc*3+1] = 2 + 4 * ((i+jc)%2);
          term[i*3+2][jc*3+2] = 2 + 4 * ((i+jc)%2);
        }
      }
    }
  }
  else {
    Qua = Nloop / 2 + 1;
    sq = Nloop / 3;
    pl = Qua - sq - 2;
    odd = 0;
    for (int j=0; j<Nloop-2; j+=2) {
      term[j][0] = 9+odd;
      term[j+1][0] = 9+odd;
      term[0][j+1] = 10+odd;
      term[0][j+2] = 10+odd;
      term[Nloop-1-j][Nloop-1] = 9+odd;
      term[Nloop-2-j][Nloop-1] = 9+odd;
      term[Nloop-1][Nloop-2-j] = 10+odd;
      term[Nloop-1][Nloop-3-j] = 10+odd;
      odd = (odd + 1) % 2;
    }
    for (int i=0; i<sq; i++) {
      plc = pl;
      for (int j=i; j<sq+i; j++) {
        jc = j % sq;
        if (plc > 0) {
          term[i*3+1][jc*3+1] = 1 + 4 * ((i+jc)%2);
          term[i*3+1][jc*3+1+1] = 1 + 4 * ((i+jc)%2);
          term[i*3+1][jc*3+2+1] = 2 + 4 * ((i+jc)%2);
          term[i*3+1+1][jc*3+2+1] = 2 + 4 * ((i+jc)%2);
          term[i*3+1+1][jc*3+1] = 3 + 4 * ((i+jc)%2);
          term[i*3+2+1][jc*3+1] = 3 + 4 * ((i+jc)%2);
          term[i*3+2+1][jc*3+1+1] = 4 + 4 * ((i+jc)%2);
          term[i*3+2+1][jc*3+2+1] = 4 + 4 * ((i+jc)%2);
          plc--;
        }
        else {
          term[i*3+1][jc*3+1] = 1 + 4 * ((i+jc)%2);
          term[i*3+1+1][jc*3+1] = 1 + 4 * ((i+jc)%2);
          term[i*3+2+1][jc*3+1+1] = 2 + 4 * ((i+jc)%2);
          term[i*3+2+1][jc*3+2+1] = 2 + 4 * ((i+jc)%2);
        }
      }
    }
  }
  
  
  
  
  for (int i=0; i<N; i++) {
    for (int j=0; j<N; j++) {
      if (term[i%Nloop][j%Nloop] != -1) {
        ans[i][j] = term[i%Nloop][j%Nloop] + 11 * ((i/Nloop+j/Nloop)%2);
      }
    }
  }
  
  char c;
  
  for (int i=0; i<N; i++) {
    for (int j=0; j<N; j++) {
      if (ans[i][j] == -1) {
        cout << '.';
      }
      else {
        c = 'a' + ans[i][j];
        cout << c;
      }
    }
    cout << endl;
  }
  
}


Measured memory_bytes: 16768