#coding:utf-8

def main():
    alphas = list('abcdefghijklmnopqrstuvwxyz')
    n = int(input())
    count_list = []
    for i in range(2 ** n - 1):
        a = str(bin(i))[2:].zfill(n)
        if a.count('0') in count_list:
            continue
        count_list.append(a.count('0'))

        idx_s = 0
        now_c = 0
        res = ''
        while idx_s < n:
            if a[idx_s] == '0':
                res += 'a'
            else:
                now_c += 1
                res += alphas[now_c]
            idx_s += 1
        print(res)
    #print(count_list)

if __name__ == '__main__':
    main()
