#include <bits/stdc++.h>
using namespace std;
template <typename tn>
inline tn next(void) {
  tn k;
  cin >> k;
  return k;
}
template <typename tn>
inline ostream& operator<<(ostream& os, const vector<tn>& v) {
  for (int i = 0; (unsigned)i < v.size(); i++) os << v[i] << ' ';
  return os;
}
char str[30];
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n = next<int>();
  switch (n) {
    case 1:
      str[1] = '\0';
      for (str[0] = 'a'; str[0] != 'b'; str[0]++) printf("%s\n", str);
      break;
    case 2:
      str[2] = '\0';
      for (str[0] = 'a'; str[0] != 'b'; str[0]++)
        for (str[1] = 'a'; str[1] <= 'j' && str[1] <= str[0] + 1; str[1]++)
          printf("%s\n", str);
      break;
    case 3:
      str[3] = '\0';
      for (str[0] = 'a'; str[0] != 'b'; str[0]++)
        for (str[1] = 'a'; str[1] <= 'j' && str[1] <= str[0] + 1; str[1]++)
          for (str[2] = 'a'; str[2] <= 'j' && str[2] <= str[1] + 1; str[2]++)
            printf("%s\n", str);
      break;
    case 4:
      str[4] = '\0';
      for (str[0] = 'a'; str[0] != 'b'; str[0]++)
        for (str[1] = 'a'; str[1] <= 'j' && str[1] <= str[0] + 1; str[1]++)
          for (str[2] = 'a'; str[2] <= 'j' && str[2] <= str[1] + 1; str[2]++)
            for (str[3] = 'a'; str[3] <= 'j' && str[3] <= str[2] + 1; str[3]++)
              printf("%s\n", str);
      break;
    case 5:
      str[5] = '\0';
      for (str[0] = 'a'; str[0] != 'b'; str[0]++)
        for (str[1] = 'a'; str[1] <= 'j' && str[1] <= str[0] + 1; str[1]++)
          for (str[2] = 'a'; str[2] <= 'j' && str[2] <= str[1] + 1; str[2]++)
            for (str[3] = 'a'; str[3] <= 'j' && str[3] <= str[2] + 1; str[3]++)
              for (str[4] = 'a'; str[4] <= 'j' && str[4] <= str[3] + 1;
                   str[4]++)
                printf("%s\n", str);
      break;
    case 6:
      str[6] = '\0';
      for (str[0] = 'a'; str[0] != 'b'; str[0]++)
        for (str[1] = 'a'; str[1] <= 'j' && str[1] <= str[0] + 1; str[1]++)
          for (str[2] = 'a'; str[2] <= 'j' && str[2] <= str[1] + 1; str[2]++)
            for (str[3] = 'a'; str[3] <= 'j' && str[3] <= str[2] + 1; str[3]++)
              for (str[4] = 'a'; str[4] <= 'j' && str[4] <= str[3] + 1;
                   str[4]++)
                for (str[5] = 'a'; str[5] <= 'j' && str[5] <= str[4] + 1;
                     str[5]++)
                  printf("%s\n", str);
      break;
    case 7:
      str[7] = '\0';
      for (str[0] = 'a'; str[0] != 'b'; str[0]++)
        for (str[1] = 'a'; str[1] <= 'j' && str[1] <= str[0] + 1; str[1]++)
          for (str[2] = 'a'; str[2] <= 'j' && str[2] <= str[1] + 1; str[2]++)
            for (str[3] = 'a'; str[3] <= 'j' && str[3] <= str[2] + 1; str[3]++)
              for (str[4] = 'a'; str[4] <= 'j' && str[4] <= str[3] + 1;
                   str[4]++)
                for (str[5] = 'a'; str[5] <= 'j' && str[5] <= str[4] + 1;
                     str[5]++)
                  for (str[6] = 'a'; str[6] <= 'j' && str[6] <= str[5] + 1;
                       str[6]++)
                    printf("%s\n", str);
      break;
    case 8:
      str[8] = '\0';
      for (str[0] = 'a'; str[0] != 'b'; str[0]++)
        for (str[1] = 'a'; str[1] <= 'j' && str[1] <= str[0] + 1; str[1]++)
          for (str[2] = 'a'; str[2] <= 'j' && str[2] <= str[1] + 1; str[2]++)
            for (str[3] = 'a'; str[3] <= 'j' && str[3] <= str[2] + 1; str[3]++)
              for (str[4] = 'a'; str[4] <= 'j' && str[4] <= str[3] + 1;
                   str[4]++)
                for (str[5] = 'a'; str[5] <= 'j' && str[5] <= str[4] + 1;
                     str[5]++)
                  for (str[6] = 'a'; str[6] <= 'j' && str[6] <= str[5] + 1;
                       str[6]++)
                    for (str[7] = 'a'; str[7] <= 'j' && str[7] <= str[6] + 1;
                         str[7]++)
                      printf("%s\n", str);
      break;
    case 9:
      str[9] = '\0';
      for (str[0] = 'a'; str[0] != 'b'; str[0]++)
        for (str[1] = 'a'; str[1] <= 'j' && str[1] <= str[0] + 1; str[1]++)
          for (str[2] = 'a'; str[2] <= 'j' && str[2] <= str[1] + 1; str[2]++)
            for (str[3] = 'a'; str[3] <= 'j' && str[3] <= str[2] + 1; str[3]++)
              for (str[4] = 'a'; str[4] <= 'j' && str[4] <= str[3] + 1;
                   str[4]++)
                for (str[5] = 'a'; str[5] <= 'j' && str[5] <= str[4] + 1;
                     str[5]++)
                  for (str[6] = 'a'; str[6] <= 'j' && str[6] <= str[5] + 1;
                       str[6]++)
                    for (str[7] = 'a'; str[7] <= 'j' && str[7] <= str[6] + 1;
                         str[7]++)
                      for (str[8] = 'a'; str[8] <= 'j' && str[8] <= str[7] + 1;
                           str[8]++)
                        printf("%s\n", str);
      break;
    case 10:
      str[10] = '\0';
      for (str[0] = 'a'; str[0] != 'b'; str[0]++)
        for (str[1] = 'a'; str[1] <= 'j' && str[1] <= str[0] + 1; str[1]++)
          for (str[2] = 'a'; str[2] <= 'j' && str[2] <= str[1] + 1; str[2]++)
            for (str[3] = 'a'; str[3] <= 'j' && str[3] <= str[2] + 1; str[3]++)
              for (str[4] = 'a'; str[4] <= 'j' && str[4] <= str[3] + 1;
                   str[4]++)
                for (str[5] = 'a'; str[5] <= 'j' && str[5] <= str[4] + 1;
                     str[5]++)
                  for (str[6] = 'a'; str[6] <= 'j' && str[6] <= str[5] + 1;
                       str[6]++)
                    for (str[7] = 'a'; str[7] <= 'j' && str[7] <= str[6] + 1;
                         str[7]++)
                      for (str[8] = 'a'; str[8] <= 'j' && str[8] <= str[7] + 1;
                           str[8]++)
                        for (str[9] = 'a';
                             str[9] <= 'j' && str[9] <= str[8] + 1; str[9]++)
                          printf("%s\n", str);
      break;
  }
  return ~~(0 - 0);
}
