#include <iostream>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <unordered_set>
#include <vector>
#include <utility>
#include <algorithm>
#include <queue>
#include <cstdint>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

constexpr ll inf = INT64_MAX / 4;
constexpr double pi = asin(1) * 2;
constexpr ll mod = 1000000007;

int main() {
    int n;
    cin >> n;
    set<string> t, u;
    t.insert("a");
    for (int i = 0; i < n - 1; i++) {
        for (auto &e:t) {
            for (char j = 'a'; j <= e.back() + 1; j++) {
                u.insert(e + j);
            }
        }
        t.clear();
        t = u;
        u.clear();
    }
    for (auto &e :t) cout << e << endl;
}