abc = 'abcdefghij'
n = int(input())
for bits in range(2 ** (n - 1)):
    cur_height = 1
    heights = []
    isfree = []
    for _ in range(n - 1):
        if bits % 2 == 1:
            cur_height += 1
            heights.append(cur_height)
            isfree.append(False)
        else:
            heights.append(cur_height)
            isfree.append(True)
        bits //= 2
    results = [[0]]
    for i in range(n - 1):
        new_results = []
        for result in results:
            if isfree[i]:
                for j in range(heights[i]):
                    new_results.append(result + [j])
            else:
                new_results.append(result + [heights[i] - 1])
        results = new_results
    for result in results:
        abcresult = (abc[i] for i in result)
        print(''.join(abcresult))