n = int(eval(input()))

s = "abcdefghij"



class Node:

#     __slots__ = ["string", "index"]

    def __init__(self, string, index):

        self.string = string

        self.index = index



    def get_children(self):

        parent = self.string

        out = [None]*(self.index+2)

        for i, c in enumerate(s[:self.index+1], 1):

            out[i] = Node(parent+c, max(i, self.index))

        return out[1:]



root = Node("a", 1)

children = [root]

for _ in range(n-1):

    parents, children = children, []

    for parent in parents:

        children.extend(parent.get_children())

for child in children:

    print((child.string))
n = int(eval(input()))

s = "abcdefghij"



class Node:

    __slots__ = ["string", "index"]

    def __init__(self, string, index):

        self.string = string

        self.index = index



    def get_children(self):

        parent = self.string

        out = [None]*(self.index+1)

        for i, c in enumerate(s[:self.index]):

            out[i] = Node(parent+c, self.index)

        out[i+1] = Node(parent+s[self.index], self.index+1)

        return out



root = Node("a", 1)

children = [root]

for _ in range(n-1):

    parents, children = children, []

    for parent in parents:

        children.extend(parent.get_children())

for child in children:

    print((child.string))
n = int(eval(input()))
s = "abcdefghij"


class Node:
    #     __slots__ = ["string", "index"]
    def __init__(self, string, index):
        self.string = string
        self.index = index

    def get_children(self):
        parent = self.string
        out = [None] * (self.index + 2)
        for i, c in enumerate(s[: self.index + 1], 1):
            out[i] = Node(parent + c, max(i, self.index))
        return out[1:]


root = Node("a", 1)
children = [root]
for _ in range(n - 1):
    parents, children = children, []
    for parent in parents:
        children.extend(parent.get_children())
for child in children:
    print((child.string))

n = int(eval(input()))
s = "abcdefghij"


class Node:
    __slots__ = ["string", "index"]

    def __init__(self, string, index):
        self.string = string
        self.index = index

    def get_children(self):
        parent = self.string
        out = [None] * (self.index + 1)
        for i, c in enumerate(s[: self.index]):
            out[i] = Node(parent + c, self.index)
        out[i + 1] = Node(parent + s[self.index], self.index + 1)
        return out


root = Node("a", 1)
children = [root]
for _ in range(n - 1):
    parents, children = children, []
    for parent in parents:
        children.extend(parent.get_children())
for child in children:
    print((child.string))

-    #     __slots__ = ["string", "index"] +    __slots__ = ["string", "index"] + -        out = [None] * (self.index + 2) -        for i, c in enumerate(s[: self.index + 1], 1): -            out[i] = Node(parent + c, max(i, self.index)) -        return out[1:] +        out = [None] * (self.index + 1) +        for i, c in enumerate(s[: self.index]): +            out[i] = Node(parent + c, self.index) +        out[i + 1] = Node(parent + s[self.index], self.index + 1) +        return out