#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1000000000;
const long long MOD = 1000000007;
inline bool maxch(int& a, int b) {
  if (a < b) {
    a = b;
    return true;
  } else
    return false;
}
inline bool minch(int& a, int b) {
  if (a > b) {
    a = b;
    return true;
  } else
    return false;
}
void dfs(string s, char c, int h) {
  s += c;
  char next = (char)(c + 1);
  if (h == 1)
    cout << s << endl;
  else
    for (char i = 'a'; i <= next; i = (char)(i + 1)) {
      dfs(s, i, h - 1);
    }
}
int main() {
  long long n;
  cin >> n;
  dfs("", 'a', n);
}
