n = int(eval(input()))

s = set(list("abcdefghijk"))



class Node:

    def __init__(self, char, parents):

        self.children = []

        self.string = parents+char

        self.charset = set(self.string)



    def get_children(self):

        parents = self.string

        for c in sorted(list(self.charset|set(min(s-self.charset)))):

            self.children.append(Node(c, parents))

        return self.children



root = Node("a", "")

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:

    def __init__(self, string, index):

        self.children = []

        self.string = string

        self.index = index



    def get_children(self):

        parent = self.string

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

            self.children.append(Node(parent+c, self.index if self.index>i else i+1))

        return self.children



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 = set(list("abcdefghijk"))


class Node:
    def __init__(self, char, parents):
        self.children = []
        self.string = parents + char
        self.charset = set(self.string)

    def get_children(self):
        parents = self.string
        for c in sorted(list(self.charset | set(min(s - self.charset)))):
            self.children.append(Node(c, parents))
        return self.children


root = Node("a", "")
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:
    def __init__(self, string, index):
        self.children = []
        self.string = string
        self.index = index

    def get_children(self):
        parent = self.string
        for i, c in enumerate(s[: self.index + 1]):
            self.children.append(
                Node(parent + c, self.index if self.index > i else i + 1)
            )
        return self.children


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))

-s = set(list("abcdefghijk")) +s = "abcdefghij" -    def __init__(self, char, parents): +    def __init__(self, string, index): -        self.string = parents + char -        self.charset = set(self.string) +        self.string = string +        self.index = index -        parents = self.string -        for c in sorted(list(self.charset | set(min(s - self.charset)))): -            self.children.append(Node(c, parents)) +        parent = self.string +        for i, c in enumerate(s[: self.index + 1]): +            self.children.append( +                Node(parent + c, self.index if self.index > i else i + 1) +            ) -root = Node("a", "") +root = Node("a", 1)