def main(n):
    if n == 1:
        return ['a']
    else:
        ans = []
        for a in main(n-1):
            b = '`'
            while b <= a[-1]:
                b = chr(ord(b) + 1)
                ans.append(a + str(b))
        return ans
N = int(input())
L = main(N)
for i in L:
    print(i)
