#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <sstream>
#include <iomanip>
using namespace std;
typedef long long ll;
int main(){
  int n = 0;
  cin >> n;
  ll jyougenn = 0;
  int keta = 0;
  keta = n - 2;
  for(int i = 0;i <= n - 1;i++){
    jyougenn += pow(10,(n - 2 - i)) * (i + 1); 
  }
  //cout << jyougenn << endl;
  for(int i = 0;i <= jyougenn;i++){
    string a = to_string(i);
    int ok = 0;
    for(int j = 1;j <= a.size() - 1;j++){
      int ima = 0;
      int mae = 0;
      ima = a[j] - '0';
      mae = a[j - 1] - '0';
      //cout << a << endl;
      if(mae + 1 < ima){
        //cout << "ok" << endl;
        ok = 1;
        j = a.size();
      }
    }
      if(a[0] - '0' <= 1){
      }
      else{
      ok = 1;
      }
    }
    //cout << "a" << a << endl;
    if(ok == 0){
      for(int j = 0;j <= n - a.size() - 1;j++){
        cout << "a";
      }
      for(int j = 0;j <= a.size() - 1;j++){
        int num = 0;
        num = a[j] - '0';
        char kotae;
        kotae = 'a' + num;
        cout << kotae;
      }
      cout << endl;
    }
  }
  return 0;
}