def calc3(l, s, N):
    if len(s) == N:
        print(s)
        return l
    if len(s) > 0:
        c = s[-1]
        s2 = s[:]
        s += chr(ord(c))
        l = calc3(l, s[:], N)
        s2 += chr(ord(c)+1)
        l = calc3(l, s2[:], N)
    else:
        c = 'a'
        s += chr(ord(c))
        l = calc3(l, s[:], N)
def main():
    N = int(input())
    l = []
    s = ''
    l = calc3(l, s[:], N)
main()
