logo AlgoBeat OnlineJudge
登录 注册

#213900. [CERC 2022] Differences

内存限制:256 MiB 时间限制:2000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

We have a list of strings . All strings have length and consist only of characters A, B, C and D. Let us define the distance between two strings and as the number of indices , where the strings have different characters (). We know that the list of strings contains precisely one special string that has distance to all other strings. Note that there might be other pairs of strings with a distance of . We are experiencing problems finding this special string, so please write a program to help us out.

输入格式

The first line contains space-separated integers , and . Strings are given in the following lines.

输出格式

Output the index of the special string. Strings are numbered from 1 to as given in the input.

样例

样例输入 1

5 10 2
DCDDDCCADA
ACADDCCADA
DBADDCCBDC
DBADDCCADA
ABADDCCADC

样例输出 1

4

样例输入 2

4 6 5
AABAAA
BAABBB
ABAAAA
ABBAAB

样例输出 2

2

数据范围与提示

Input limits