def getStr(vars):
    if len(vars)==N:
        print(getPrintStr(vars))
        return
    
    vars.append(0)
    for i in range(0,vars[-2]+2):
        vars[-1] = i
        #print(":", i, vars)
        getStr(vars)
    del vars[-1]
    return

def getPrintStr(vars):
    ret = ""
    for i in range(len(vars)):
        ret += "abcdefghijkl"[vars[i]]
    return ret

N = int(input())
 
getStr([0])

