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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Jialin Ouyang (Jialin.Ouyang@gmail.com)
 */
public class Main {
  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    QuickScanner in = new QuickScanner(inputStream);
    QuickWriter out = new QuickWriter(outputStream);
    TaskE solver = new TaskE();
    solver.solve(1, in, out);
    out.close();
  }

  static class TaskE {
    static final int MAXN = 200;
    static final int MAXM = MAXN * (MAXN - 1) / 2 + MAXN;
    int n;
    int m;
    int m2;
    BlockableBidirectionalGraph graph;
    int[] bfs;
    int[] path;
    int[] lastOut;
    boolean[] visited;

    public void solve(int testNumber, QuickScanner in, QuickWriter out) {
      graph = new BlockableBidirectionalGraph(MAXN, MAXM);
      bfs = new int[MAXN];
      lastOut = new int[MAXN];
      visited = new boolean[MAXN];
      path = new int[MAXM];
      for (int remTask = in.nextInt(); remTask > 0; --remTask) {
        n = in.nextInt();
        m = in.nextInt();
        m2 = m << 1;
        graph.init(n);
        for (int i = 0; i < m; ++i) {
          graph.add(in.nextInt() - 1, in.nextInt() - 1);
        }
        int res = 0;
        for (int i = 0; i < n; ++i) {
          res += 1 - (graph.outDegree[i] & 1);
        }
        out.println(res);
        calc(out);
      }
    }

    void calc(QuickWriter out) {
      Arrays.fill(visited, 0, n, false);
      for (int i = 0; i < n; ++i) lastOut[i] = graph.lastOut[i];
      for (int i = 0; i < n; ++i)
        if (!visited[i]) {
          int bfsCnt = BfsOrder.calc(graph, i, bfs, visited);
          int lastIdx = -1;
          for (int j = 0; j < bfsCnt; ++j) {
            int idx = bfs[j];
            if ((graph.outDegree[idx] & 1) == 0) continue;
            if (lastIdx < 0) {
              lastIdx = idx;
            } else {
              graph.add(lastIdx, idx);
              lastOut[lastIdx] = graph.lastOut[lastIdx];
              lastOut[idx] = graph.lastOut[idx];
              lastIdx = -1;
            }
          }
          int pathCnt = EulerPath.calc(i, graph, lastOut, path);
          for (int j = 0; j < pathCnt; ++j) {
            int edgeIdx = path[j];
            if (edgeIdx >= m2) continue;
            out.println(graph.fromIdx[edgeIdx] + 1, graph.toIdx[edgeIdx] + 1);
          }
        }
    }

  }

  static class BlockableBidirectionalGraph extends BlockableDirectedGraph {
    public BlockableBidirectionalGraph(int vertexCapacity, int edgeCapacity) {
      super(vertexCapacity, edgeCapacity << 1);
    }


    public void add(int fromIdx, int toIdx) {
      super.add(fromIdx, toIdx);
      super.add(toIdx, fromIdx);
    }


    public void block(int edgeIdx) {
      super.block(edgeIdx);
      super.block(edgeIdx ^ 1);
    }

  }

  static class IntArrayUtils {
    public static void reverse(int[] values, int fromIdx, int toIdx) {
      for (int i = fromIdx, j = toIdx - 1; i < j; ++i, --j) {
        values[i] ^= values[j];
        values[j] ^= values[i];
        values[i] ^= values[j];
      }
    }

  }

  static class EulerPath {
    public static int calc(int startIdx, BlockableDirectedGraph graph, int[] lastOut, int[] resPath) {
      int res = calcInternal(startIdx, -1, graph, lastOut, resPath, 0);
      IntArrayUtils.reverse(resPath, 0, res);
      return res;
    }

    private static int calcInternal(
        int nodeIdx, int prevEdgeIdx, BlockableDirectedGraph graph, int[] lastOut, int[] resPath, int resCnt) {

      while (lastOut[nodeIdx] >= 0) {
        int edgeIdx = lastOut[nodeIdx];
        lastOut[nodeIdx] = graph.nextOut[edgeIdx];
        if (!graph.blocked[edgeIdx]) {
          graph.block(edgeIdx);
          resCnt = calcInternal(
              graph.toIdx[edgeIdx], edgeIdx, graph, lastOut, resPath, resCnt);
        }
      }
      if (prevEdgeIdx >= 0) {
        resPath[resCnt++] = prevEdgeIdx;
      }
      return resCnt;
    }

  }

  static class DirectedGraph {
    public int vertexCnt;
    public int edgeCnt;
    public int[] fromIdx;
    public int[] toIdx;
    public int[] nextIn;
    public int[] nextOut;
    public int[] lastIn;
    public int[] lastOut;
    public int[] inDegree;
    public int[] outDegree;

    public DirectedGraph(int vertexCapacity, int edgeCapacity) {
      create(vertexCapacity, edgeCapacity);
      init(vertexCapacity);
    }

    public void create(int vertexCapacity, int edgeCapacity) {
      fromIdx = new int[edgeCapacity];
      toIdx = new int[edgeCapacity];
      lastIn = new int[vertexCapacity];
      lastOut = new int[vertexCapacity];
      nextIn = new int[edgeCapacity];
      nextOut = new int[edgeCapacity];
      inDegree = new int[vertexCapacity];
      outDegree = new int[vertexCapacity];
    }

    public void init(int vertexCnt) {
      this.vertexCnt = vertexCnt;
      this.edgeCnt = 0;
      Arrays.fill(inDegree, 0, vertexCnt, 0);
      Arrays.fill(outDegree, 0, vertexCnt, 0);
      Arrays.fill(lastIn, 0, vertexCnt, -1);
      Arrays.fill(lastOut, 0, vertexCnt, -1);
    }

    public void add(int fromIdx, int toIdx) {
      this.fromIdx[edgeCnt] = fromIdx;
      this.toIdx[edgeCnt] = toIdx;
      ++outDegree[fromIdx];
      ++inDegree[toIdx];
      nextOut[edgeCnt] = lastOut[fromIdx];
      lastOut[fromIdx] = edgeCnt;
      nextIn[edgeCnt] = lastIn[toIdx];
      lastIn[toIdx] = edgeCnt;
      ++edgeCnt;
    }

  }

  static class BfsOrder {
    public static int calc(DirectedGraph graph, int startIdx, int[] bfs, boolean[] visited) {
      if (visited[startIdx]) return 0;
      visited[startIdx] = true;
      int res = 0;
      bfs[res++] = startIdx;
      for (int i = 0; i < res; ++i) {
        int u = bfs[i];
        for (int edgeIdx = graph.lastOut[u]; edgeIdx >= 0; edgeIdx = graph.nextOut[edgeIdx]) {
          int v = graph.toIdx[edgeIdx];
          if (!visited[v]) {
            visited[v] = true;
            bfs[res++] = v;
          }
        }
      }
      return res;
    }

  }

  static class QuickWriter {
    private final PrintWriter writer;

    public QuickWriter(OutputStream outputStream) {
      this.writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public QuickWriter(Writer writer) {
      this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
      for (int i = 0; i < objects.length; ++i) {
        if (i > 0) {
          writer.print(' ');
        }
        writer.print(objects[i]);
      }
    }

    public void println(Object... objects) {
      print(objects);
      writer.print('\n');
    }

    public void close() {
      writer.close();
    }

  }

  static class QuickScanner {
    private static final int BUFFER_SIZE = 1024;
    private InputStream stream;
    private byte[] buffer;
    private int currentPosition;
    private int numberOfChars;

    public QuickScanner(InputStream stream) {
      this.stream = stream;
      this.buffer = new byte[BUFFER_SIZE];
      this.currentPosition = 0;
      this.numberOfChars = 0;
    }

    public int nextInt() {
      int c = nextNonSpaceChar();
      boolean positive = true;
      if (c == '-') {
        positive = false;
        c = nextChar();
      }
      int res = 0;
      do {
        if (c < '0' || '9' < c) throw new RuntimeException();
        res = res * 10 + c - '0';
        c = nextChar();
      } while (!isSpaceChar(c));
      return positive ? res : -res;
    }

    public int nextNonSpaceChar() {
      int res = nextChar();
      for (; isSpaceChar(res) || res < 0; res = nextChar()) ;
      return res;
    }

    public int nextChar() {
      if (numberOfChars == -1) {
        throw new RuntimeException();
      }
      if (currentPosition >= numberOfChars) {
        currentPosition = 0;
        try {
          numberOfChars = stream.read(buffer);
        } catch (Exception e) {
          throw new RuntimeException(e);
        }
        if (numberOfChars <= 0) {
          return -1;
        }
      }
      return buffer[currentPosition++];
    }

    public boolean isSpaceChar(int c) {
      return c == ' '
          || c == '\n'
          || c == '\r'
          || c == '\t'
          || c < 0;
    }

  }

  static class BlockableDirectedGraph extends DirectedGraph {
    public boolean[] blocked;

    public BlockableDirectedGraph(int vertexCapacity, int edgeCapacity) {
      super(vertexCapacity, edgeCapacity);
    }


    public void create(int vertexCapacity, int edgeCapacity) {
      super.create(vertexCapacity, edgeCapacity);
      blocked = new boolean[edgeCapacity];
    }


    public void add(int fromIdx, int toIdx) {
      blocked[edgeCnt] = false;
      super.add(fromIdx, toIdx);
    }

    public void block(int edgeIdx) {
      blocked[edgeIdx] = true;
    }

  }
}

