#include <bits/stdc++.h>
using namespace std;
int a[10] = {0, 1, 12, 123, 1234, 12345, 123456, 1234567, 12345678, 123456789};
string generate(int x, int n) {
  string s = "";
  int i = 0;
  while (x > 0) {
    s += ('a' + (x % 10));
    x = x / 10;
    i++;
  }
  while (i < n) {
    s += 'a';
    i++;
  }
  reverse(s.begin(), s.end());
  return s;
}
void solve() {
  int n = 0;
  cin >> n;
  vector<string> res;
  res.push_back(generate(0, n));
  for (int i = 0; i < n; i++) {
    int x = a[i];
    int modu = x % 10;
    for (int j = 0; j <= modu; j++) {
      if (x - j != 0) res.push_back(generate(x - j, n));
    }
  }
  sort(res.begin(), res.end());
  for (int i = 0; i < res.size(); i++) {
    cout << res[i] << "\n";
  }
  return;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
