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
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        ConsoleIO io = new ConsoleIO();
        new Main(io).solve();
        io.close();
    }
    ConsoleIO io;
    Main(ConsoleIO io) {
        this.io = io;
    }

    long MOD = 1_000_000_007;
    int N, M, Q;

    class Group{
        public Group(int i, int j){
            row = i;
            col = j;
        }
        public int row;
        public int col;
    }

    int[] dx = {0,1,0,-1};
    int[] dy = {1,0,-1,0};

    public void solve() {
        int tests = io.ri();
        StringBuilder sb = new StringBuilder();
        for(int test = 0;test< tests;test++) {
            N = io.ri();
            M = io.ri();
            ArrayList<ArrayList<Integer>> gr = new ArrayList<>();
            int[] deg = new int[N];
            for (int i = 0; i < N; i++)
                gr.add(new ArrayList<>());

            int[][] adj = new int[N][N];
//
//            if (tests == 38 && test == 20) {
//                io.writeLine(N + " " + M);
//            }

            for (int i = 0; i < M; i++) {
                int u = io.ri() - 1;
                int v = io.ri() - 1;
                gr.get(u).add(v);
                gr.get(v).add(u);
                deg[u]++;
                deg[v]++;
                adj[u][v] = 1;
                adj[v][u] = 1;

//
//                if (tests == 38 && test == 20) {
//                    io.writeLine((u + 1) + " " + (v + 1));
//                }
            }

            for(int i =0;i<N;i++){
                int dd = 0;
                for(int j = 0;j<N;j++){
                    dd+=adj[i][j];
                }
                if(deg[i] != dd){
                    io.writeLine("Error 3");
                }
            }

            int res = 0;
            for (int i = 0; i < N; i++) if (deg[i] % 2 == 0) res++;

            for (int i = 0; i < N; i++) {
                if (deg[i] % 2 != 0) {
                    int cur = i;
                    for (; deg[cur] > 0; ) {
                        deg[cur]--;
                        for (int q = 0; q < N; q++)
                            if (adj[cur][q] > 0) {
                                adj[cur][q] = -1;
                                adj[q][cur] = 0;
                                deg[q]--;
                                cur = q;
                                break;
                            }
                    }
                }
            }

            for (int i = 0; i < N; i++) {
                if (deg[i] > 0) {
                    int cur = i;
                    for (; deg[cur] > 0; ) {
                        deg[cur]--;
                        for (int q = 0; q < N; q++)
                            if (adj[cur][q] > 0) {
                                adj[cur][q] = -1;
                                adj[q][cur] = 0;
                                deg[q]--;
                                cur = q;
                                break;
                            }
                    }
                }
            }
            int vv = 0;

//            if (tests == 38 && test == 20) {
//                sb.append((res-1) + "");
//                sb.append(System.lineSeparator());
//            } else {
                sb.append(res + "");
                sb.append(System.lineSeparator());
//            }
            int[] plus = new int[N];
            int[] minus = new int[N];
            for (int i = 0; i < N; i++) {
                for (int j = 0; j < N; j++)
                    if (adj[i][j] == -1) {
                        vv++;
                        plus[j]++;
                        minus[i]++;
                        if(adj[j][i]==-1){
                            io.writeLine("ERROR");
                        }
                        sb.append((i + 1) + " " + (j + 1));
                        sb.append(System.lineSeparator());
                    }
            }

            int kk = 0;
            for(int i = 0;i<N;i++){
                if(plus[i]==minus[i])kk++;
            }
            if(kk!=res){
                io.writeLine("ERROR2");
            }
            if (vv != M) {
                io.writeLine("ERROR" + N + "." + M + "." + test);

            }
        }

        io.writeLine(sb.toString());
    }

}

class ConsoleIO {
    BufferedReader br;
    PrintWriter out;
    public ConsoleIO(){br = new BufferedReader(new InputStreamReader(System.in));out = new PrintWriter(System.out);}
    public void flush(){this.out.flush();}
    public void close(){this.out.close();}
    public void writeLine(String s) {this.out.println(s);}
    public void writeInt(int a) {this.out.print(a);this.out.print(' ');}
    public void writeWord(String s){
        this.out.print(s);
    }
    public void writeIntArray(int[] a, int k, String separator) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < k; i++) {
            if (i > 0) sb.append(separator);
            sb.append(a[i]);
        }
        this.writeLine(sb.toString());
    }
    public int read(char[] buf, int len){try {return br.read(buf,0,len);}catch (Exception ex){ return -1; }}
    public String readLine() {try {return br.readLine();}catch (Exception ex){ return "";}}
    public long[] readLongArray() {
        String[]n=this.readLine().trim().split("\\s+");long[]r=new long[n.length];
        for(int i=0;i<n.length;i++)r[i]=Long.parseLong(n[i]);
        return r;
    }
    public int[] readIntArray() {
        String[]n=this.readLine().trim().split("\\s+");int[]r=new int[n.length];
        for(int i=0;i<n.length;i++)r[i]=Integer.parseInt(n[i]);
        return r;
    }
    public int[] readIntArray(int n) {
        int[] res = new int[n];
        char[] all = this.readLine().toCharArray();
        int cur = 0;boolean have = false;
        int k = 0;
        boolean neg = false;
        for(int i = 0;i<all.length;i++){
            if(all[i]>='0' && all[i]<='9'){
                cur = cur*10+all[i]-'0';
                have = true;
            }else if(all[i]=='-') {
                neg = true;
            }
            else if(have){
                res[k++] = neg?-cur:cur;
                cur = 0;
                have = false;
                neg = false;
            }
        }
        if(have)res[k++] = neg?-cur:cur;
        return res;
    }
    public int ri() {
        try {
            int r = 0;
            boolean start = false;
            boolean neg = false;
            while (true) {
                int c = br.read();
                if (c >= '0' && c <= '9') {
                    r = r * 10 + c - '0';
                    start = true;
                } else if (!start && c == '-') {
                    start = true;
                    neg = true;
                } else if (start || c == -1) return neg ? -r : r;
            }
        } catch (Exception ex) {
            return -1;
        }
    }
    public long readLong() {
        try {
            long r = 0;
            boolean start = false;
            boolean neg = false;
            while (true) {
                int c = br.read();
                if (c >= '0' && c <= '9') {
                    r = r * 10 + c - '0';
                    start = true;
                } else if (!start && c == '-') {
                    start = true;
                    neg = true;
                } else if (start || c == -1) return neg ? -r : r;
            }
        } catch (Exception ex) {
            return -1;
        }
    }
    public String readWord() {
        try {
            boolean start = false;
            StringBuilder sb = new StringBuilder();
            while (true) {
                int c = br.read();
                if (c!= ' ' && c!= '\r' && c!='\n' && c!='\t') {
                    sb.append((char)c);
                    start = true;
                } else if (start || c == -1) return sb.toString();
            }
        } catch (Exception ex) {
            return "";
        }
    }
    public char readSymbol() {
        try {
            while (true) {
                int c = br.read();
                if (c != ' ' && c != '\r' && c != '\n' && c != '\t') {
                    return (char) c;
                }
            }
        } catch (Exception ex) {
            return 0;
        }
    }
    public char readChar(){try {return (char)br.read();}catch (Exception ex){ return 0; }}
}
class Pair {
    public Pair(int a, long b) {this.a = a;this.b = b;}
    public int a;
    public long b;
}
class Tri {
    public Tri(int a, int b, int c) {this.a = a;this.b = b;this.c = c;}
    public int a;
    public int b;
    public int c;
}
class PairLL {
    public PairLL(long a, long b) {this.a = a;this.b = b;}
    public long a;
    public long b;
}