#include <bits/stdc++.h>
using namespace std;
void dfs(vector<string>& perm, string& str, const int& n) {
  if (str.length() == n) {
    perm.push_back(str);
    return;
  }
  for (char c = 'a'; c <= 'a' + n - 1; ++c) {
    str += c;
    dfs(perm, str, n);
    str.pop_back();
  }
}
int main() {
  int n;
  cin >> n;
  vector<string> perm;
  string str;
  dfs(perm, str, n - 1);
  for (string& s : perm) {
    cout << 'a' << s << '\n';
  }
  for (int i = 0; i < n; ++i) {
    cout << char('a' + i);
  }
  cout << '\n';
  return 0;
}
