#include <bits/stdc++.h>
using namespace std;
vector<string> vi;
int n;
void dfs(int pos, string str) {
  if (pos == n) {
    vi.push_back(str);
    return;
  }
  char akhir = str.back();
  akhir++;
  for (akhir; akhir >= 'a'; akhir--) {
    dfs(pos + 1, str + akhir);
  }
}
int main() {
  int i, j, k, x, y, ans, temp, curr, m;
  int tc;
  cin >> n;
  dfs(1, "a");
  sort(vi.begin(), vi.end());
  for (auto x : vi) cout << x << endl;
  return 0;
}
