Task
Ancient viking people carved stories on stone using their own symbols. Björn found versions of the same story and he already converted them to texts containing only the lowercase letters a-z. The texts are indexed from 0 to , let's denote them with . All the texts have the same length , but they might differ on some positions.
Now Björn wants to know which is the original version of the story, because he thinks that the others are just mutated copies of it. He suspects that the original text is the one that has the minimal average distance from all the others. We define the distance between two texts as the number of positions where they differ.
More formally, the distance between two texts and denoted by is the number of different indices, for which and . We are looking for the text for which the value = is minimal. (Note that ). If there are multiple texts with the same average distance from the others, you should choose the one which has the smallest index of those.
Can you help Björn to determine which one is the original text?
Input
The first line contains two integers and (), (). The following lines each contain a string of length containing only lowercase English letters abc...z.
For tests worth points, .
For tests worth more points, .
For tests worth more points, .
For tests worth more points, consists of only letters and .
Output
You need to write a single line with an integer between and , the index of the original text. If there are multiple possible solutions, print the one with the smallest index.
Example 1
stdin
3 3
aab
aba
aaa
stdout
2
Example 2
stdin
5 7
abcdefg
abcdefh
abcdefh
abcdefi
abcdefj
stdout
1
Explanation
In the first sample case,
- = + dist(aab, aaa)) = =
- = + dist(aba, aaa)) = =
- = + dist(aaa, aba)) = =
So, the last text has the minimal average distance from the others, hence the answer is its index, which is 2.
In the second sample case, abcdefh has an average distance of while the other texts have an average distance of , so the solution is the index of the first occurrence of abcdefh, which is 1.