#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int cnt = 1;
void backtrack(int m) {
  if (m == n) {
    cout << s << "\n";
    return;
  }
  for (int i = 0; i <= cnt; i++) {
    char c = s[m - 1] + i;
    s += c;
    backtrack(m + 1);
    s = s.substr(0, s.length() - 1);
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cin >> n;
  s = "a";
  backtrack(1);
}
