# -*- coding: utf-8 -*-

alphabets = list('abcdefghijklmnopqrstuvwxyz')

N = int(input())

if N == 1:
    print('a')
else:
    tmp = ['a']
    for i in range(1, N):
        result = []
        for s in tmp:
            for alphabet in set(list(s)):
                result.append(s+alphabet)
            result.append(s+alphabets[len(set(list(s)))])
            tmp = result
    print('\n'.join(result))


