import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)
INF = 10**30

A = "abcdefghij"
N = 0
def dfs(s, lim):
    global N
    if len(s) == N:
        print("".join(s))
        # s = []
        return
    for i in range(lim): # abacなどが入らない
        s.append(A[i])
        dfs(s, len(set(s)) + 1)
        s.pop()
    # print(s)
    # dfs(s, prev)
    # s[-1] = A[prev + 1]
    # dfs(s, n+1, prev+1)

def main():
    global N
    N = int(input().strip())
    dfs([], 1)

if __name__ == '__main__':
    main()

c6e656e10bcbde12b24b579546aa053471a2bf99
<mask token>


def dfs(s, lim):
    global N
    if len(s) == N:
        print(''.join(s))
        return
    for i in range(lim):
        s.append(A[i])
        dfs(s, len(set(s)) + 1)
        s.pop()


def main():
    global N
    N = int(input().strip())
    dfs([], 1)


<mask token>

<mask token>
sys.setrecursionlimit(10000000)
<mask token>


def dfs(s, lim):
    global N
    if len(s) == N:
        print(''.join(s))
        return
    for i in range(lim):
        s.append(A[i])
        dfs(s, len(set(s)) + 1)
        s.pop()


def main():
    global N
    N = int(input().strip())
    dfs([], 1)


if __name__ == '__main__':
    main()

<mask token>
input = sys.stdin.readline
<mask token>
sys.setrecursionlimit(10000000)
INF = 10 ** 30
A = 'abcdefghij'
N = 0


def dfs(s, lim):
    global N
    if len(s) == N:
        print(''.join(s))
        return
    for i in range(lim):
        s.append(A[i])
        dfs(s, len(set(s)) + 1)
        s.pop()


def main():
    global N
    N = int(input().strip())
    dfs([], 1)


if __name__ == '__main__':
    main()

import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)
INF = 10 ** 30
A = 'abcdefghij'
N = 0


def dfs(s, lim):
    global N
    if len(s) == N:
        print(''.join(s))
        return
    for i in range(lim):
        s.append(A[i])
        dfs(s, len(set(s)) + 1)
        s.pop()


def main():
    global N
    N = int(input().strip())
    dfs([], 1)


if __name__ == '__main__':
    main()

import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)
INF = 10**30

A = "abcdefghij"
N = 0
def dfs(s, lim):
    global N
    if len(s) == N:
        print("".join(s))
        # s = []
        return
    for i in range(lim): # abacなどが入らない
        s.append(A[i])
        dfs(s, len(set(s)) + 1)
        s.pop()
    # print(s)
    # dfs(s, prev)
    # s[-1] = A[prev + 1]
    # dfs(s, n+1, prev+1)

def main():
    global N
    N = int(input().strip())
    dfs([], 1)

if __name__ == '__main__':
    main()
