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:
import java.io.*;
import java.util.*;

public class onewayreform {
	public static void main(String[] ags)
	{
		InputReader in=new InputReader(System.in);
		int t=in.nextInt();
		PrintWriter pw=new PrintWriter(System.out);
		while(t-->0)
		{
			int n=in.nextInt();
			int m=in.nextInt();
			List<Integer> g[]=new List[n+1];
			int[][] dp=new int[n+1][n+1];
			int[] degree=new int[n+1];
			for(int i=0;i<=n;i++)
			{
				g[i]=new ArrayList<Integer>();
			}
			for(int i=0;i<m;i++)
			{
				int u=in.nextInt()-1;
				int v=in.nextInt()-1;
				g[u].add(v);
				g[v].add(u);
				degree[u]++;
				degree[v]++;
			}
			boolean[] visited=new boolean[n+1];
			int count=n;
			for(int i=0;i<n;i++)
			{
				if(degree[i]%2==1)
				{
					g[i].add(n);
					g[n].add(i);
					count--;
				}
			}
			for(int i=0;i<n;i++)
			{
				if(!visited[i])
				{
				List<Integer> tt=eulerCycleUndirected(g,i);
				for(int j=1;j<tt.size();j++)
				{
					dp[tt.get(j-1)][tt.get(j)]=1;
					visited[tt.get(j)]=true;
				}
				
				}
			}
			
			pw.println(count);
			for(int i=0;i<n;i++)
			{
				for(int j=0;j<n;j++)
				{
					if(dp[i][j]==1)
					{
						pw.println((i+1)+" "+(j+1));
					}
				}
			}
			
			
		}
		pw.close();
	}

	  public static List<Integer> eulerCycleUndirected(List<Integer>[] graph, int u) {
	    Set<Long> usedEdges = new HashSet<>();
	    int n = graph.length;
	    int[] curEdge = new int[n];
	    List<Integer> res = new ArrayList<>();
	    dfs(graph, curEdge, usedEdges, res, u);
	    Collections.reverse(res);
	    return res;
	  }

	  static void dfs(List<Integer>[] graph, int[] curEdge, Set<Long> usedEdges, List<Integer> res, int u) {
	    while (curEdge[u] < graph[u].size()) {
	      int v = graph[u].get(curEdge[u]++);
	      if (usedEdges.add(((long) Math.min(u, v) << 32) + Math.max(u, v)))
	        dfs(graph, curEdge, usedEdges, res, v);
	    }
	    res.add(u);
	  }

	  public static List<Integer> eulerCycleUndirected2(List<Integer>[] graph, int u) {
	    int[] curEdge = new int[graph.length];
	    List<Integer> res = new ArrayList<>();
	    Stack<Integer> stack = new Stack<>();
	    Set<Long> usedEdges = new HashSet<>();
	    stack.add(u);
	    while (!stack.isEmpty()) {
	      u = stack.pop();
	      while (curEdge[u] < graph[u].size()) {
	        int v = graph[u].get(curEdge[u]++);
	        if (usedEdges.add((((long) Math.min(u, v) << 32) + Math.max(u, v)))) {
	          stack.push(u);
	          u = v;
	        }
	      }
	      res.add(u);
	    }
	    Collections.reverse(res);
	    return res;
	  }

	  public static List<Integer> eulerCycleDirected(List<Integer>[] graph, int u) {
	    int n = graph.length;
	    int[] curEdge = new int[n];
	    List<Integer> res = new ArrayList<>();
	    dfs(graph, curEdge, res, u);
	    Collections.reverse(res);
	    return res;
	  }

	  static void dfs(List<Integer>[] graph, int[] curEdge, List<Integer> res, int u) {
	    while (curEdge[u] < graph[u].size()) {
	      dfs(graph, curEdge, res, graph[u].get(curEdge[u]++));
	    }
	    res.add(u);
	  }

	  public static List<Integer> eulerCycleDirected2(List<Integer>[] graph, int v) {
	    int[] curEdge = new int[graph.length];
	    List<Integer> res = new ArrayList<>();
	    Stack<Integer> stack = new Stack<>();
	    stack.add(v);
	    while (!stack.isEmpty()) {
	      v = stack.pop();
	      while (curEdge[v] < graph[v].size()) {
	        stack.push(v);
	        v = graph[v].get(curEdge[v]++);
	      }
	      res.add(v);
	    }
	    Collections.reverse(res);
	    return res;
	  }
	static class InputReader {

		private InputStream stream;
		private byte[] buf = new byte[8192];
		private int curChar;
		private int snumChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int snext() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}

			int res = 0;

			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));

			return res * sgn;
		}
		
		public long nextLong() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}

			long res = 0;

			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));

			return res * sgn;
		}
		
		public String readString() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}


}