#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const string str = "abcdefghij";
int N;
set<string> st;
void connectS(int count, string s, int prev) {
  count++;
  for (int i = 0; i < prev + 2; i++) {
    if (count == N) {
      st.insert(s + str[i]);
    } else {
      connectS(count, s + str[i], i);
    }
  }
  return;
}
int main() {
  cin >> N;
  connectS(0, "", -1);
  for (auto a : st) cout << a << endl;
  return 0;
}
