Problem: There are n cities and m two-way roads in Berland, each road connects two cities. It is known that there is no more than one road connecting each pair of cities, and there is no road which connects the city with itself. It is possible that there is no way to get from one city to some other city using only these roads.

The road minister decided to make a reform in Berland and to orient all roads in the country, i.e. to make each road one-way. The minister wants to maximize the number of cities, for which the number of roads that begins in the city equals to the number of roads that ends in it.

Input

The first line contains a positive integer t (1 ≤ t ≤ 200) — the number of testsets in the input.

Each of the testsets is given in the following way. The first line contains two integers n and m (1 ≤ n ≤ 200, 0 ≤ m ≤ n·(n - 1) / 2) — the number of cities and the number of roads in Berland. 

The next m lines contain the description of roads in Berland. Each line contains two integers u and v (1 ≤ u, v ≤ n) — the cities the corresponding road connects. It's guaranteed that there are no self-loops and multiple roads. It is possible that there is no way along roads between a pair of cities.

It is guaranteed that the total number of cities in all testset of input data doesn't exceed 200.

Pay attention that for hacks, you can only use tests consisting of one testset, so t should be equal to one.

Output

For each testset print the maximum number of such cities that the number of roads that begins in the city, is equal to the number of roads that ends in it.

In the next m lines print oriented roads. First print the number of the city where the road begins and then the number of the city where the road ends. If there are several answers, print any of them. It is allowed to print roads in each test in arbitrary order. Each road should be printed exactly once. 

Example

Input

2
5 5
2 1
4 5
2 3
1 3
3 5
7 2
3 7
4 2


Output

3
1 3
3 5
5 4
3 2
2 1
3
2 4
3 7

Solution (in JAVA):

Solution:
/**
 * Created by Aminul on 8/1/2018.
 */

import java.io.*;
import java.util.*;
import static java.lang.Math.*;

public class CF723E {
    public static void main(String[] args)throws Exception {
        FastReader in = new FastReader(System.in);
        PrintWriter pw = new PrintWriter(System.out);

        int test = in.nextInt();
        for(int t = 1; t <= test; t++) {
            solve(in, pw);
        }

        pw.close();
    }

    static void solve(FastReader in, PrintWriter pw) throws  Exception{
        int res = -1;
        int n = in.nextInt(), m = in.nextInt();
        int u[] = new int[m], v[] = new int[m];
        for (int i = 0; i < m; i++) {
            u[i] = in.nextInt();
            v[i] = in.nextInt();
        }

        int ans[] = {};
        for (int trial = 1; trial <= 1000; trial++) {
            int inDegree[] = new int[n+1], outDegree[] = new int[n+1] ;
            int dir[] = new int[m];
            Random random = new Random();
            for (int i = 0; i < m; i++) {
                if(random.nextBoolean()){
                    dir[i] = 1;
                    inDegree[v[i]]++;
                    outDegree[u[i]]++;
                }
                else{
                    dir[i] = 0;
                    inDegree[u[i]]++;
                    outDegree[v[i]]++;
                }
            }

            for (int i = 0; i < m; i++) {
                if(dir[i] == 1 && inDegree[u[i]] < outDegree[u[i]] &&  outDegree[v[i]] < inDegree[v[i]]){
                    dir[i] = 0;
                    inDegree[v[i]]--; outDegree[u[i]]--;
                    inDegree[u[i]]++; outDegree[v[i]]++;
                }
                else if(dir[i] == 0 && inDegree[u[i]] > outDegree[u[i]] && outDegree[v[i]] > inDegree[v[i]]){
                    dir[i] = 1;
                    inDegree[u[i]]--; outDegree[v[i]]--;
                    inDegree[v[i]]++; outDegree[u[i]]++;
                }
            }

            int tmp = 0;
            for (int i = 1; i <= n; i++) {
                if(inDegree[i] == outDegree[i]) tmp++;
            }

            if(tmp > res){
                res = tmp;
                ans = dir.clone();
            }
        }


        pw.println(res);
        for (int i = 0; i < m; i++) {
            if(ans[i] == 1) pw.println(u[i]+" "+v[i]);
            else pw.println(v[i]+ " "+u[i]);
        }

    }

    static <T>List<T>[] genList(int n){
        List<T> list[] = new List[n];
        for(int i = 0; i < n; i++) list[i] = new ArrayList<T>();
        return list;
    }

    static void debug(Object...obj) {
        System.err.println(Arrays.deepToString(obj));
    }

    static class FastReader {
        InputStream is;
        private byte[] inbuf = new byte[1024];
        private int lenbuf = 0, ptrbuf = 0;
        static final int ints[] = new int[128];

        public FastReader(InputStream is){
            for(int i='0';i<='9';i++) ints[i]=i-'0';
            this.is = is;
        }

        public int readByte(){
            if(lenbuf == -1)throw new InputMismatchException();
            if(ptrbuf >= lenbuf){
                ptrbuf = 0;
                try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
                if(lenbuf <= 0)return -1;
            }
            return inbuf[ptrbuf++];
        }

        public boolean isSpaceChar(int c) {
            return !(c >= 33 && c <= 126);
        }
        public int skip() {
            int b;
            while((b = readByte()) != -1 && isSpaceChar(b));
            return b;
        }

        public String next(){
            int b = skip();
            StringBuilder sb = new StringBuilder();
            while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

        public int nextInt(){
            int num = 0, b;
            boolean minus = false;
            while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
            if(b == '-'){
                minus = true;
                b = readByte();
            }

            while(true){
                if(b >= '0' && b <= '9'){
                    num = (num<<3) + (num<<1) + ints[b];
                }else{
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }

        public long nextLong() {
            long num = 0;
            int b;
            boolean minus = false;
            while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
            if(b == '-'){
                minus = true;
                b = readByte();
            }

            while(true){
                if(b >= '0' && b <= '9'){
                    num = (num<<3) + (num<<1) + ints[b];
                }else{
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
       /* public char nextChar() {
            return (char)skip();
        }*/

        public char[] next(int n){
            char[] buf = new char[n];
            int b = skip(), p = 0;
            while(p < n && !(isSpaceChar(b))){
                buf[p++] = (char)b;
                b = readByte();
            }
            return n == p ? buf : Arrays.copyOf(buf, p);
        }

        /*private char buff[] = new char[1005];
        public char[] nextCharArray(){
            int b = skip(), p = 0;
            while(!(isSpaceChar(b))){
                buff[p++] = (char)b;
                b = readByte();
            }
            return Arrays.copyOf(buff, p);
        }*/
    }
}