#include <bits/stdc++.h>
using namespace std;
const long long maxs = 1e6 + 5;
const long long lmaxs = 20;
long long mod = 1e9 + 7;
long long oo = 1e9;
bool go(string str1, string str2) {
  int m = str1.length(), n = str2.length();
  if (m != n) return false;
  bool marked[256] = {false};
  int map[256];
  memset(map, -1, sizeof(map));
  for (int i = 0; i < n; i++) {
    if (map[str1[i]] == -1) {
      if (marked[str2[i]] == true) return false;
      marked[str2[i]] = true;
      map[str1[i]] = str2[i];
    } else if (map[str1[i]] != str2[i])
      return false;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long T = 1;
  while (T--) {
    long long n;
    cin >> n;
    string s = "";
    set<string> SET;
    vector<vector<char>> a{{'a'},
                           {'a', 'b'},
                           {'a', 'b', 'c'},
                           {'a', 'b', 'c', 'd'},
                           {'a', 'b', 'c', 'd', 'e'},
                           {'a', 'b', 'c', 'd', 'e', 'f'},
                           {'a', 'b', 'c', 'd', 'e', 'f', 'g'},
                           {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'},
                           {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'},
                           {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'}};
    for (long long b = 0; b < a[0].size(); b++, s.pop_back()) {
      s = "";
      s += a[0][b];
      if (n == 1) {
        long long flg = true;
        for (auto it : SET) {
          if (go(it, s)) {
            flg = false;
            break;
          }
        }
        if (flg) SET.insert(s);
        continue;
      }
      for (long long c = 0; c < a[1].size(); c++, s.pop_back()) {
        s += a[1][c];
        if (n == 2) {
          long long flg = true;
          for (auto it : SET) {
            if (go(it, s)) {
              flg = false;
              break;
            }
          }
          if (flg) SET.insert(s);
          continue;
        }
        for (long long d = 0; d < a[2].size(); d++, s.pop_back()) {
          s += a[2][d];
          if (n == 3) {
            long long flg = true;
            for (auto it : SET) {
              if (go(it, s)) {
                flg = false;
                break;
              }
            }
            if (flg) SET.insert(s);
            continue;
          }
          for (long long e = 0; e < a[3].size(); e++, s.pop_back()) {
            s += a[3][e];
            if (n == 4) {
              long long flg = true;
              for (auto it : SET) {
                if (go(it, s)) {
                  flg = false;
                  break;
                }
              }
              if (flg) SET.insert(s);
              continue;
            }
            for (long long f = 0; f < a[4].size(); f++, s.pop_back()) {
              s += a[4][f];
              if (n == 5) {
                long long flg = true;
                for (auto it : SET) {
                  if (go(it, s)) {
                    flg = false;
                    break;
                  }
                }
                if (flg) SET.insert(s);
                continue;
              }
              for (long long g = 0; g < a[5].size(); g++, s.pop_back()) {
                s += a[5][g];
                if (n == 6) {
                  long long flg = true;
                  for (auto it : SET) {
                    if (go(it, s)) {
                      flg = false;
                      break;
                    }
                  }
                  if (flg) SET.insert(s);
                  continue;
                }
                for (long long h = 0; h < a[6].size(); h++, s.pop_back()) {
                  s += a[6][g];
                  if (n == 7) {
                    long long flg = true;
                    for (auto it : SET) {
                      if (go(it, s)) {
                        flg = false;
                        break;
                      }
                    }
                    if (flg) SET.insert(s);
                    continue;
                  }
                  for (long long i = 0; i < a[7].size(); i++, s.pop_back()) {
                    s += a[7][i];
                    if (n == 8) {
                      long long flg = true;
                      for (auto it : SET) {
                        if (go(it, s)) {
                          flg = false;
                          break;
                        }
                      }
                      if (flg) SET.insert(s);
                      continue;
                    }
                    for (long long j = 0; j < a[8].size(); j++, s.pop_back()) {
                      s += a[8][j];
                      if (n == 9) {
                        long long flg = true;
                        for (auto it : SET) {
                          if (go(it, s)) {
                            flg = false;
                            break;
                          }
                        }
                        if (flg) SET.insert(s);
                        continue;
                      }
                      for (long long k = 0; k < a[9].size();
                           k++, s.pop_back()) {
                        s += a[9][k];
                        long long flg = true;
                        for (auto it : SET) {
                          if (go(it, s)) {
                            flg = false;
                            break;
                          }
                        }
                        if (flg) SET.insert(s);
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    for (auto it : SET) cout << it << endl;
  }
  return 0;
}
