
def main():
    N = int(input())
    li = 'abcdefghijklmnopqrstuvwxyz'

    def f(k):
        nonlocal li
        if k == 1:
            return ['a']
        else:
            temp = f(k-1)
            return [t+char for t in temp for char in li[:k]]

    result = f(N)
    print(sorted(result))

if __name__ == '__main__':
    main()
