import itertools

def main():
    N = int(input())
    letterset = ['a', 'b', 'c', 'd', 'e', 'f', 'e', 'h', 'i', 'j']
    for i in range(1, N+1):
        iters = itertools.combinations_with_replacement(letterset[:i], N)
        for tmp in iters:
            if len(set(tmp)) == i:
                print(''.join(tmp))

if __name__ == "__main__":
    main()
