
if __name__ == '__main__':
    n = int(input())
    r = lambda n: [''] if n <= 0 else [e + j for e in r(n - 1) for j in [chr(ord('a') + e) for e in range(n)]]
    a = r(n)
    for e in a:
        print(e)