#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  if (N == 1) cout << "a" << endl;
  if (N == 2)
    cout << "aa"
         << "ab" << endl;
  if (N == 3)
    cout << "aaa"
         << "aab"
         << "aba"
         << "abb"
         << "abc" << endl;
  if (N == 4) {
    for (char i = 'a'; i <= 'b'; i++) {
      for (char j = 'a'; j <= i + 1; j++) {
        for (char k = 'a'; k <= max(i, j) + 1; k++) {
          cout << "a" << i << j << k << endl;
        }
      }
    }
  }
  if (N == 5) {
    for (char i = 'a'; i <= 'b'; i++) {
      for (char j = 'a'; j <= i + 1; j++) {
        for (char k = 'a'; k <= max(i, j) + 1; k++) {
          for (char l = 'a'; l <= max({i, j, k}) + 1; l++) {
            cout << "a" << i << j << k << l << endl;
          }
        }
      }
    }
  }
  if (N == 6) {
    for (char i = 'a'; i <= 'b'; i++) {
      for (char j = 'a'; j <= i + 1; j++) {
        for (char k = 'a'; k <= max(i, j) + 1; k++) {
          for (char l = 'a'; l <= max({i, j, k}) + 1; l++) {
            for (char m = 'a'; m <= max({i, j, k, l}) + 1; m++) {
              cout << "a" << i << j << k << l << m << endl;
            }
          }
        }
      }
    }
  }
  if (N == 7) {
    for (char i = 'a'; i <= 'b'; i++) {
      for (char j = 'a'; j <= i + 1; j++) {
        for (char k = 'a'; k <= max(i, j) + 1; k++) {
          for (char l = 'a'; l <= max({i, j, k}) + 1; l++) {
            for (char m = 'a'; m <= max({i, j, k, l}) + 1; m++) {
              for (char n = 'a'; n <= max({i, j, k, l, m}) + 1; l++) {
                cout << "a" << i << j << k << l << m << n << endl;
              }
            }
          }
        }
      }
    }
  }
  if (N == 8) {
    for (char i = 'a'; i <= 'b'; i++) {
      for (char j = 'a'; j <= i + 1; j++) {
        for (char k = 'a'; k <= max(i, j) + 1; k++) {
          for (char l = 'a'; l <= max({i, j, k}) + 1; l++) {
            for (char m = 'a'; m <= max({i, j, k, l}) + 1; m++) {
              for (char n = 'a'; n <= max({i, j, k, l, m}) + 1; n++) {
                for (char o = 'a'; o <= max({i, j, k, l, m, n}) + 1; o++) {
                  cout << "a" << i << j << k << l << m << n << o << endl;
                }
              }
            }
          }
        }
      }
    }
  }
  if (N == 9) {
    for (char i = 'a'; i <= 'b'; i++) {
      for (char j = 'a'; j <= i + 1; j++) {
        for (char k = 'a'; k <= max(i, j) + 1; k++) {
          for (char l = 'a'; l <= max({i, j, k}) + 1; l++) {
            for (char m = 'a'; m <= max({i, j, k, l}) + 1; m++) {
              for (char n = 'a'; n <= max({i, j, k, l, m}) + 1; n++) {
                for (char o = 'a'; o <= max({i, j, k, l, m, n}) + 1; o++) {
                  for (char p = 'a'; p <= max({i, j, k, l, m, n, o}) + 1; p++) {
                    cout << "a" << i << j << k << l << m << n << o << p << endl;
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  if (N == 10) {
    for (char i = 'a'; i <= 'b'; i++) {
      for (char j = 'a'; j <= i + 1; j++) {
        for (char k = 'a'; k <= max(i, j) + 1; k++) {
          for (char l = 'a'; l <= max({i, j, k}) + 1; l++) {
            for (char m = 'a'; m <= max({i, j, k, l}) + 1; m++) {
              for (char n = 'a'; n <= max({i, j, k, l, m}) + 1; n++) {
                for (char o = 'a'; o <= max({i, j, k, l, m, n}) + 1; o++) {
                  for (char p = 'a'; p <= max({i, j, k, l, m, n, o}) + 1; p++) {
                    for (char q = 'a'; q <= max({i, j, k, l, m, n, o, p}) + 1;
                         q++) {
                      cout << "a" << i << j << k << l << m << n << o << p << q
                           << endl;
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  return 0;
}
