#!/usr/bin/env python3
import sys
import numpy as np

al = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]

def solve(N: int):
    
    def p_out(ppp):
        print("".join([al[p] for p in ppp]))

    def rec_ad(token, ttl):

        if ttl != 0:
            for k in range(max(token)+2):
                rec_ad(token + [k], ttl - 1)
        else :
            p_out(token)

    rec_ad([0], N-1)

    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()
