#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
vector<string> res;
int n;
void dfs(string s, char las) {
  if (s.length() == n) {
    res.push_back(s);
    return;
  }
  for (char c = 'a'; c <= las + 1; c++) {
    dfs(s + c, c);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  sort(res.begin(), res.end());
  dfs("", char('a' - 1));
  for (string it : res) {
    cout << it << endl;
  }
  return 0;
}
