Ice Game#2737

Ice Game

1 second
64 megabytes
Very hard

To join Skipper's team, a penguin must pass a series of tests: Skipper's obstacle course, a sparring match with Rico, code decryption from Private, and a puzzle from Kowalski.

You, the rookie penguin, have successfully reached the final challenge. Kowalski proposes the following game. You are given sets of colorful ice floes, each floe being of one of colors. Different colors are represented by various lowercase Latin letters. You can select a subset of these sets under the condition that each color appears in the selected sets at most once. Suppose you select sets with indices i_1, i_2, \ldots, i_k, then your score is equal to the sum l_{i_1} + l_{i_2} + \cdots + l_{i_k}, where l_{i_j} is the number of floes in set i_j.

Kowalski requires you to find a subset with the maximum possible score.

You need to find any subset that satisfies Kowalski's conditions.

Input

The first line contains the integer (1 \leq n \leq 17) — the number of different colors. The second line contains (1 \leq m \leq 200000) — the number of different sets of floes. The next lines describe the sets themselves. The set with number is given as a string using the first lowercase Latin letters. Each string has a length of at most characters.

Output

In the first line, output — the number of sets in your answer. In the second line, output integers — the indices of the sets included in the answer, in any order.

Examples

Example 1

Loading
Loading