#include <bits/stdc++.h>
using namespace std;
int n;
vector<char> v;
vector<string> st;
void solve(void) {
  vector<string> ans;
  char c[26];
  bool ok;
  for (int i = 0; i < (st.size()); i++) {
    ok = true;
    for (int j = 0; j < (ans.size()); j++) {
      for (int i = 0; i < (26); i++) c[i] = -1;
      for (int k = 0; k < (st[i].size()); k++) {
        if (c[st[i][k] - 'a'] != -1) {
          if (c[st[i][k] - 'a'] != ans[j][k]) {
            ok = false;
            break;
          }
        } else
          c[st[i][k] - 'a'] = ans[j][k];
      }
      if (!ok) break;
    }
    if (ok) ans.push_back(st[i]);
  }
  for (int i = 0; i < (ans.size()); i++) cout << ans[i] << endl;
}
void dfs(int i) {
  int j = 0;
  while (j < 10) {
    if (!(i > 0 && v[i - 1] + 1 < 'a' + j || i == 0 && 'a' + j > 'a')) {
      v[i] = 'a' + j;
      if (i == n) {
        string tmp;
        for (int i = 0; i < (n); i++) tmp += v[i];
        st.push_back(tmp);
        return;
      } else
        dfs(i + 1);
    }
    j++;
  }
}
signed main(void) {
  cin >> n;
  v = vector<char>(n);
  dfs(0);
  return 0;
}
