Glorious Brilliance

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

문제

Professor Zhang is trying to solve one of Karp's 21 NP-complete problems: the Graph Coloring Problem.

At first, he generates an undirected graph with nn vertices and mm edges. Then, he colors all the vertices black or white. Finally, he wants to use the following operation to make the vertices correctly colored: choose two adjacent vertices and swap their colors. The vertices are correctly colored if and only if no two adjacent vertices share the same color.

Professor Zhang wants to know the minimum number of operations needed.

입력

There are multiple test cases. The first line of input contains an integer TT indicating the number of test cases. For each test case:

The first line contains two integers nn and mm (2n5002 \le n \le 500, 1mn(n1)21 \le m \le \frac{n \cdot (n - 1)}{2}): the number of vertices and the number of edges. The second line contains a binary string of length nn. The ii-th vertex is colored white if the ii-th character is '0', or black otherwise.

Each of the next mm lines contains two integers x_ix\_i and y_iy\_i (1x_i,y_in1 \le x\_i, y\_i \le n, x_iy_ix\_i \ne y\_i) denoting an undirected edge.

There are at most 200200 test cases, and the total size of the input is no more than 1.51.5 mebibytes.

출력

For each test case, output an integer ss denoting the minimum number of operations in the first line. Each of the next ss lines must contain two integers u_iu\_i and v_iv\_i (1u_i,v_in1 \le u\_i, v\_i \le n, u_iv_iu\_i \ne v\_i) denoting the ii-th operation.

If there is no such solution, just output "1-1" on a single line.