The first line contains an integer T — the number of tests. It is followed by test descriptions. The first line of a test description contains a single positive integer N — the number of strings in the set. Each of the following N lines begins with a nonnegative integer L — the length of the string from the set, followed by the string itself, separated by a space. The string only contains lowercase latin letters a, g, t, c. Note that a string in the set can be empty. In this case the line in the file will only contain the digit 0 and a space symbol. The total number of strings in all sets is not greater than 2000. The sum of lengths of all strings in all sets is not greater than 2000.