#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <iterator>
#include <limits>
#include <set>
#include <map>

bool is_same(const std::string& a, const std::string& b)
{
    const size_t len = a.size();

    for (size_t i = 0; i < len; i++) {
        for (size_t j = i; j < len; j++) {
            if (!((a[i] == a[j] && b[i] == b[j]) || (a[i] != a[j] && b[i] != b[j]))) {
                return false;
            }
        }
    }
    return true;
}
 
int main()
{
    int n{};
    std::cin >> n;
    std::string s(n, 'a');
    std::vector<std::string> result = { s };

    for (int i = 1; i < n; i++) {
        const auto tmp = result;
        for (auto x : tmp) {
            while (x[i] <= 'z') {
                x[i]++;
                if (std::any_of(result.begin(), result.end(), [&x](const auto& y) { return is_same(x, y);})) {
                    break;
                }
                result.emplace_back(x);
            }
        }
    }
    for (auto&& x : result) {
        std::cout << x << std::endl;
    }
    return 0;
}