n = int(input())
words = ['a', 'b', 'c', 'd', 'e', 'f','g','h', 'i', 'j']
ans = []
a0 = ""
for i in range(1,n + 1)[::-1]:
    ai = a0 + words[0] * i
    if len(ai) == n:
        ans.append(ai)
    for j in range(1, n + 1 - i)[::-1]:
        aj = ai + words[1] * j
        if len(aj) == n:
            ans.append(aj)
        for k in range(1, n + 1 - i - j)[::-1]:
            ak = aj + words[2] * k
            if len(ak) == n:
                ans.append(ak)

            for l in range(1, n + 1 - i - j - k)[::-1]:
                al = ak + words[3] * l
                if len(al) == n:
                    ans.append(al)

                for m in range(1, n + 1 - i - j - k - l)[::-1]:
                    am = al + words[4] * m
                    if len(am) == n:
                        ans.append(am)
                    for o in range(1, n + 1 - i - j - k - l - m)[::-1]:
                        ao = am + words[5] * o
                        if len(ao) == n:
                            ans.append(ao)
                        for p in range(1, n + 1 - i - j - k - l - m - o)[::-1]:
                            ap = ao + words[6] * p
                            if len(ap) == n:
                                ans.append(ap)
                            for q in range(1, n + 1 - i - j - k - l - m - o - p)[::-1]:
                                aq = ap + words[7] * q
                                if len(aq) == n:
                                    ans.append(aq)
                                for r in range(1, n + 1 - i - j - k - l - m - o - p - q)[::-1]:
                                    ar = aq + words[8] * r
                                    if len(ar) == n:
                                        ans.append(ar)
                                    for s in range(1, n + 1 - i - j - k - l - m - o - p - q - r)[::-1]:
                                        ass = ar + words[9] * s
                                        if len(ass) == n:
                                            ans.append(ass)


for a in ans:
    print(a)
