def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = list(map(int, input().split()))
    #a = [input().split() for i in range(n)]
    #a = [int(input()) for i in range(n)]
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0
    n=int(input())
    s = ('a','b','c','d','e','f','g','h','i','j')
    s = s[:n]
    if n==1:
        print('a')
        return 0
    if n==2:
        print('aa')
        print('ab')
        return 0
    import itertools
    for i in list(itertools.combinations_with_replacement(s, n)):
        if i[0] < 'b':
            print(*i, sep="")
            if len(set(i)) == n:
                return 0 
        else:
            return 0

if __name__ == '__main__':
    main()

