N = int(input())

def it(remain,n):
    if remain == 0:
        yield tuple()
    else:
        for d in it(remain-1,n):
            for x in range(n):
                yield (x,)+d
        for d in it(remain-1,n+1):
            yield (n,)+d


print(*(''.join(chr(x+ord('a')) for x in d) for d in it(N,0)), sep='\n')

