Checking Answers to Test

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Today students had a test. The test consists of nn multiple-choice questions. Each question has four answer options "A", "B", "C" and "D", but only one of them is correct.

The teacher knows that the students often cheat. So he wants to find all pairs of students who have similar answers. Two students have similar answers if for each of them more than half of their correct answers match with the other student's answers, and more than half of their incorrect answers match with the other student's answers.

Help the teacher find all pairs of students who have similar answers to the test.

입력

The first line of input contains one integer nn denoting the number of questions in the test (1n1001 \le n \le 100).

The second line contains correct answers, they are represented by a string of length nn. The string consists of letters "A", "B", "C" and "D", the ii-th letter is the correct answer for the ii-th question.

The third line contains one integer mm denoting the number of students, who had the test today (1m1001 \le m \le 100).

Next mm lines contain students' answers in the same format as the correct answers. The ii-th line contains the answers given by the ii-th student.

출력

The first line of output must contain the number of pairs of students who have similar answers. The following lines must contain all such pairs of students, in any order. You can output the numbers in one pair in any order.