#pypyは内包表記使わない, rstrip注意
#提出前に見返すこと！
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate
    #from itertools import product
    from bisect import bisect_left,bisect_right
    import heapq
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    N = int(input())
    d = deque(['a'])
    while len(d[0])<N:
        s = d.popleft()
        if s[-1]=='a':
            d.append(s+'a')
            d.append(s+'b')
        elif s[-1]=='b':
            d.append(s+'a')
            d.append(s+'b')
            d.append(s+'c')
        else:
            d.append(s+'a')
            d.append(s+chr(ord(s[-1])+1))
    while len(d)!=0:
        print(d.popleft())


if __name__ == '__main__':
    main()