N=int(input())
if N==1:
    print('a')
elif N==2:
    a=97
    for b in range(97,99):
        print(''.join(chr(x) for x in [a,b]))
elif N==3:
    a=97
    for b in range(97,99):
        for c in range(97,100):
            print(''.join(chr(x) for x in [a,b,c]))
elif N==4:
    a=97
    for b in range(97,99):
        for c in range(97,100):
            for d in range(97,101):
                print(''.join(chr(x) for x in [a,b,c,d]))
elif N==5:
    a=97
    for b in range(97,99):
        for c in range(97,100):
            for d in range(97,101):
                for e in range(97,102):
                    print(''.join(chr(x) for x in [a,b,c,d,e]))
elif N==6:
    a=97
    for b in range(97,99):
        for c in range(97,100):
            for d in range(97,101):
                for e in range(97,102):
                    for f in range(97,103):
                        print(''.join(chr(x) for x in [a,b,c,d,e,f]))
elif N==7:
    a=97
    for b in range(97,99):
        for c in range(97,100):
            for d in range(97,101):
                for e in range(97,102):
                    for f in range(97,103):
                        for g in range(97,104):
                            print(''.join(chr(x) for x in [a,b,c,d,e,f,g]))
elif N==8:
    a=97
    for b in range(97,99):
        for c in range(97,100):
            for d in range(97,101):
                for e in range(97,102):
                    for f in range(97,103):
                        for g in range(97,104):
                            for h in range(97,105):
                                print(''.join(chr(x) for x in [a,b,c,d,e,f,g,h]))
elif N==9:
    a=97
    for b in range(97,99):
        for c in range(97,100):
            for d in range(97,101):
                for e in range(97,102):
                    for f in range(97,103):
                        for g in range(97,104):
                            for h in range(97,105):
                                for i in range(97,106):
                                    print(''.join(chr(x) for x in [a,b,c,d,e,f,g,h,i]))
else:
    a=97
    for b in range(97,99):
        for c in range(97,100):
            for d in range(97,101):
                for e in range(97,102):
                    for f in range(97,103):
                        for g in range(97,104):
                            for h in range(97,105):
                                for i in range(97,106):
                                    for j in range(97,107):
                                        print(''.join(chr(x) for x in [a,b,c,d,e,f,g,h,i,j]))