#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int oo = 1e9 + 5;
int n;
string s;
set<string> all;
void rec(int pos, int mx) {
  if (pos == n) {
    all.insert(s);
    return;
  }
  for (int i = 'a' - 0; i <= min('z' - 0, mx + 1); ++i) {
    s.push_back(char(i));
    rec(pos + 1, i);
    s.pop_back();
  }
}
void solve() {
  cin >> n;
  s.push_back('a');
  rec(1, 'a' - 0);
  for (string t : all) cout << t << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tt = 1;
  while (tt--) {
    solve();
  }
  return 0;
}
