#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;

int n;

void dfs(string s, char mx){
  if(s.size() == n){
    cout << s << endl;
    return;
  }
  for(char c = 'a'; c <= mx+1; c++){
    string t = s;
    t += c;
    dfs(t, max(c, mx));
  }
}