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

def offset(strings):
    ret = ''
    for si in strings:
        ret += chr(ord(si) + 1)
    return ret

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

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


if __name__ == '__main__':
    main()