n=int(input())
dic={0:'a',1:'b',2:'c',3:'d',4:'e',5:'f',6:'g',7:'h',8:'i',9:'j'}
ans=[['a',1]]
for i in range(1,n):
  tmp=[]
  for prev,val in ans:
    for j in range(val+1):
      if j!=val:
        tmp.append([prev+dic[j],val])
      else:
        tmp.append([prev+dic[j],val+1])
  ans=tmp
ans=sorted(ans,key=lambda x:x[0])
print(len(ans))
for i in range(len(ans)):
  print(ans[i][0])