strings=["a","b","c","d","e","f","g","h","i","j"]


N=int(input())
def f(x):
    for i in x:
        print(strings[i],end="")
    if x[-1]==N-1:
        return ""
    print("")
    if x[-1]-1==x[-2]:
        x[-1]+=1
        return f(g(x,N-1))
    else:
        x[-1]+=1
        return f(x)


def g(x,level):
    if x[level]-1<=x[level-1]:
        return x
    x[level]=0
    x[level-1]+=1
    level-=1
    return g(x,level)

a=[]
for i in range(N):
    a.append(0)
f(a)