# coding: utf-8


def solve(*args: str) -> str:
    n = int(args[0])
    c = 'a'
    S = [c]*n
    ret = [''.join(S)]
    for i in range(n):
        for j in reversed(range(i, n)):
            if S[j] < c:
                S[j] = c
                ret.append(''.join(S))
            else:
                break

        c = chr(ord(c)+1)

    return '\n'.join(ret)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))
