#include <iostream>
#include <vector>
#include <algorithm>

#include <boost/range/adaptors.hpp>


void Extend(const std::vector<std::string>& input, std::vector<std::string>& output) {
    if (input.empty()) {
        output.push_back("a");
        return;
    }
    for (const auto x : input) {
        if (x.back() == 'a') {
            output.push_back(x + "a");
            output.push_back(x + "b");
        } else if (x.back() == 'b') {
            output.push_back(x + "a");
            output.push_back(x + "b");
            output.push_back(x + "c");
        } else if (x.back() == 'c') {
            output.push_back(x + "a");
            output.push_back(x + "b");
            output.push_back(x + "c");
            output.push_back(x + "d");
        } else if (x.back() == 'd') {
            output.push_back(x + "a");
            output.push_back(x + "b");
            output.push_back(x + "c");
            output.push_back(x + "d");
            output.push_back(x + "e");
        } else if (x.back() == 'e') {
            output.push_back(x + "a");
            output.push_back(x + "b");
            output.push_back(x + "c");
            output.push_back(x + "d");
            output.push_back(x + "e");
            output.push_back(x + "f");
        } else if (x.back() == 'f') {
            output.push_back(x + "a");
            output.push_back(x + "b");
            output.push_back(x + "c");
            output.push_back(x + "d");
            output.push_back(x + "e");
            output.push_back(x + "f");
            output.push_back(x + "g");
        } else if (x.back() == 'g') {
            output.push_back(x + "a");
            output.push_back(x + "b");
            output.push_back(x + "c");
            output.push_back(x + "d");
            output.push_back(x + "e");
            output.push_back(x + "f");
            output.push_back(x + "g");
            output.push_back(x + "h");
        } else if (x.back() == 'h') {
            output.push_back(x + "a");
            output.push_back(x + "b");
            output.push_back(x + "c");
            output.push_back(x + "d");
            output.push_back(x + "e");
            output.push_back(x + "f");
            output.push_back(x + "g");
            output.push_back(x + "h");
            output.push_back(x + "i");
        } else if (x.back() == 'i') {
            output.push_back(x + "a");
            output.push_back(x + "b");
            output.push_back(x + "c");
            output.push_back(x + "d");
            output.push_back(x + "e");
            output.push_back(x + "f");
            output.push_back(x + "g");
            output.push_back(x + "h");
            output.push_back(x + "i");
            output.push_back(x + "j");
        }
    }
}

int main() {
    int N;
    std::cin >> N;
    std::vector<std::string> candidates;
    for (int i = 0; i < N; ++i) {
        std::vector<std::string> result;
        Extend(candidates, result);
        candidates.swap(result);
    }
    for (const auto x : candidates) {
        std::cout << x << std::endl;
    }
    return 0;
}