#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k, l, r;
  cin >> n;
  r = 1;
  for (i = 0; i < n; i++) {
    r = r * n;
  }
  int S[r][n], IS[r], C;
  for (i = 0; i < r; i++) {
    IS[i] = 0;
    C = i;
    for (j = n - 1; j >= 0; j--) {
      S[i][j] = C % n;
      C = C / n;
    }
  }
  for (i = 0; i < r - 1; i++) {
    for (k = i + 1; k < r; k++) {
      if (IS[k] == 1) {
        continue;
      }
      IS[k] = 1;
      for (j = 0; j < n - 1; j++) {
        for (l = j + 1; l < n; l++) {
          if (!((S[i][j] == S[i][l] && S[k][j] == S[k][l]) ||
                (S[i][j] != S[i][l] && S[k][j] != S[k][l]))) {
            IS[k] = 0;
            break;
          }
        }
        if (IS[k] == 0) {
          break;
        }
      }
    }
  }
  for (i = 0; i < r; i++) {
    if (IS[i] == 0) {
      for (j = 0; j < n; j++) {
        cout << (char)(97 + S[i][j]);
      }
      cout << endl;
    }
  }
}
