#include <bits/stdc++.h>
using namespace std;
const int INF = 2000000000;
const int MOD = 1000000007;
vector<string> answer;
long long int n;
void dfs(string s) {
  if (s.size() == n) {
    answer.push_back(s);
  } else {
    char cs = s.at(s.size() - 1);
    char num = cs + 1;
    for (char i = 'a'; i <= num; i++) {
      dfs(s + i);
    }
  }
}
int main() {
  cin >> n;
  dfs("a");
  for (int i = 0; i < answer.size(); i++) {
    cout << answer.at(i) << endl;
  }
}
