#!/usr/bin python3
# -*- coding: utf-8 -*-

def offset(strings,k):
    ret = ''
    for i in range(k):
        ret += chr(ord(strings[i]) + 1)
    ret += strings[k:]
    return ret

def stds(n):
    if n == 1:
        return set(['a'])
    else:
        std = stds(n-1)
        ret = set([])
        for stdi in std:
            for i in range(n):
                ret.add('a' + offset(stdi,i))
#                print(ret)
        return ret

def main():
    N = int(input())
    ret = list(stds(N))
    ret.sort()
    print('\n'.join(ret))

if __name__ == '__main__':
    main()