#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
void recurse(string& s, int i, int n, char c);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  string s(n, 'a');
  recurse(s, 0, n, 'a');
}
void recurse(string& s, int i, int n, char c) {
  if (i == n) {
    cout << s << '\n';
  } else {
    for (char letter = 'a'; letter < c; ++letter) {
      s[i] = letter;
      recurse(s, i + 1, n, c);
    }
    s[i] = c;
    recurse(s, i + 1, n, min(char(c + 1), 'z'));
  }
}
