wen, dream, and moon did not score enough to pass the course, so all three had to take the make-up exam. The exam had n multiple choice questions worth one point each, and every question offered the four choices A, B, C, and D. The three handed in their answer sheets for computer grading. After the exam their friend drazil checked the sheets and found that all three had answered every question wrong.
drazil feels sorry for them, so he decides to break into the teacher's computer and rewrite the standard answers. He may set the standard answer of each question to any of A, B, C, or D, and he wants the lowest of the three scores to be as high as possible.
For example, suppose the exam had 3 questions, wen answered ABC, dream answered BCD, moon answered CDA, and the original standard answers were DAB. All three were wrong on every question, so drazil rewrites the standard answers as CCC and each of them then has exactly one correct answer.
Given the three answer sheets, find the largest value that the minimum of the three scores can reach after drazil rewrites the standard answers. The original standard answers are not part of the input, because drazil picks a new answer for every question.
The first line contains an integer T (1≤T≤100), the number of test cases.
Each test case takes four lines. The first line contains an integer n (1≤n≤30000), the number of questions. The next three lines give the answer sheets of wen, dream, and moon in that order. Each sheet is a string of n characters drawn from A, B, C, and D, and its i-th character is the answer written for question i.
For each test case, print one line with the largest value that the minimum of the three scores can reach.