#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const double PI = 3.141592653589793238463;
const int MAXN = 1e5 + 5;
long long fastPow(long long x, long long b) {
  if (b == 0)
    return 1;
  else if (!(b & 1)) {
    return fastPow(x * x, b / 2);
  } else
    return x * fastPow(x * x, (b - 1) / 2);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  if (n == 1) {
    cout << "a" << '\n';
  } else if (n == 2) {
    cout << "aa\n"
            "ab"
         << '\n';
  } else if (n == 3) {
    set<string> s;
    for (char i = 'a'; i <= 'a'; i++) {
      for (char j = 'a'; j <= 'b'; j++) {
        for (char k = 'a'; k <= 'c'; k++) {
          string h;
          h.push_back(i);
          h.push_back(j);
          h.push_back(k);
          s.insert(h);
        }
      }
    }
    for (auto i = s.begin(); i != s.end(); i++) cout << *i << '\n';
  } else if (n == 4) {
    set<string> s;
    for (char i = 'a'; i <= 'a'; i++) {
      for (char j = 'a'; j <= 'b'; j++) {
        for (char k = 'a'; k <= 'c'; k++) {
          for (char a = 'a'; a <= 'd'; a++) {
            string h;
            h.push_back(i);
            h.push_back(j);
            h.push_back(k);
            h.push_back(a);
            s.insert(h);
          }
        }
      }
    }
    for (auto i = s.begin(); i != s.end(); i++) cout << *i << '\n';
  } else if (n == 5) {
    set<string> s;
    for (char i = 'a'; i <= 'a'; i++) {
      for (char j = 'a'; j <= 'b'; j++) {
        for (char k = 'a'; k <= 'c'; k++) {
          for (char a = 'a'; a <= 'd'; a++) {
            for (char b = 'a'; b <= 'e'; b++) {
              string h;
              h.push_back(i);
              h.push_back(j);
              h.push_back(k);
              h.push_back(a);
              h.push_back(b);
              s.insert(h);
            }
          }
        }
      }
    }
    for (auto i = s.begin(); i != s.end(); i++) cout << *i << '\n';
  } else if (n == 6) {
    set<string> s;
    for (char i = 'a'; i <= 'a'; i++) {
      for (char j = 'a'; j <= 'b'; j++) {
        for (char k = 'a'; k <= 'c'; k++) {
          for (char a = 'a'; a <= 'd'; a++) {
            for (char b = 'a'; b <= 'e'; b++) {
              for (char c = 'a'; c <= 'f'; c++) {
                string h;
                h.push_back(i);
                h.push_back(j);
                h.push_back(k);
                h.push_back(a);
                h.push_back(b);
                h.push_back(c);
                s.insert(h);
              }
            }
          }
        }
      }
    }
    for (auto i = s.begin(); i != s.end(); i++) cout << *i << '\n';
  } else if (n == 7) {
    set<string> s;
    for (char i = 'a'; i <= 'a'; i++) {
      for (char j = 'a'; j <= 'b'; j++) {
        for (char k = 'a'; k <= 'c'; k++) {
          for (char a = 'a'; a <= 'd'; a++) {
            for (char b = 'a'; b <= 'e'; b++) {
              for (char c = 'a'; c <= 'f'; c++) {
                for (char d = 'a'; d <= 'g'; d++) {
                  string h;
                  h.push_back(i);
                  h.push_back(j);
                  h.push_back(k);
                  h.push_back(a);
                  h.push_back(b);
                  h.push_back(c);
                  h.push_back(d);
                  s.insert(h);
                }
              }
            }
          }
        }
      }
    }
    for (auto i = s.begin(); i != s.end(); i++) cout << *i << '\n';
  } else if (n == 8) {
    set<string> s;
    for (char i = 'a'; i <= 'a'; i++) {
      for (char j = 'a'; j <= 'b'; j++) {
        for (char k = 'a'; k <= 'c'; k++) {
          for (char a = 'a'; a <= 'd'; a++) {
            for (char b = 'a'; b <= 'e'; b++) {
              for (char c = 'a'; c <= 'f'; c++) {
                for (char d = 'a'; d <= 'g'; d++) {
                  for (char e = 'a'; e <= 'h'; e++) {
                    string h;
                    h.push_back(i);
                    h.push_back(j);
                    h.push_back(k);
                    h.push_back(a);
                    h.push_back(b);
                    h.push_back(c);
                    h.push_back(d);
                    h.push_back(e);
                    s.insert(h);
                  }
                }
              }
            }
          }
        }
      }
    }
    for (auto i = s.begin(); i != s.end(); i++) cout << *i << '\n';
  } else if (n == 9) {
    set<string> s;
    for (char i = 'a'; i <= 'a'; i++) {
      for (char j = 'a'; j <= 'b'; j++) {
        for (char k = 'a'; k <= 'c'; k++) {
          for (char a = 'a'; a <= 'd'; a++) {
            for (char b = 'a'; b <= 'e'; b++) {
              for (char c = 'a'; c <= 'f'; c++) {
                for (char d = 'a'; d <= 'g'; d++) {
                  for (char e = 'a'; e <= 'h'; e++) {
                    for (char x = 'a'; x <= 'i'; x++) {
                      string h;
                      h.push_back(i);
                      h.push_back(j);
                      h.push_back(k);
                      h.push_back(a);
                      h.push_back(b);
                      h.push_back(c);
                      h.push_back(d);
                      h.push_back(e);
                      h.push_back(x);
                      s.insert(h);
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    for (auto i = s.begin(); i != s.end(); i++) cout << *i << '\n';
  } else {
    set<string> s;
    for (char i = 'a'; i <= 'a'; i++) {
      for (char j = 'a'; j <= 'b'; j++) {
        for (char k = 'a'; k <= 'c'; k++) {
          for (char a = 'a'; a <= 'd'; a++) {
            for (char b = 'a'; b <= 'e'; b++) {
              for (char c = 'a'; c <= 'f'; c++) {
                for (char d = 'a'; d <= 'g'; d++) {
                  for (char e = 'a'; e <= 'h'; e++) {
                    for (char x = 'a'; x <= 'i'; x++) {
                      for (char y = 'a'; y <= 'j'; y++) {
                        string h;
                        h.push_back(i);
                        h.push_back(j);
                        h.push_back(k);
                        h.push_back(a);
                        h.push_back(b);
                        h.push_back(c);
                        h.push_back(d);
                        h.push_back(e);
                        h.push_back(x);
                        h.push_back(y);
                        s.insert(h);
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    for (auto i = s.begin(); i != s.end(); i++) cout << *i << '\n';
  }
  return 0;
}
