Artem is building a new robot. He has a matrix a consisting of n rows and m columns. The cell located on the i-th row from the top and the j-th column from the left has a value a_{i,j} written in it. 

If two adjacent cells contain the same value, the robot will break. A matrix is called good if no two adjacent cells contain the same value, where two cells are called adjacent if they share a side. 

Artem wants to increment the values in some cells by one to make a good.

More formally, find a good matrix b that satisfies the following condition — 

  * For all valid (i,j), either b_{i,j} = a_{i,j} or b_{i,j} = a_{i,j}+1. 



For the constraints of this problem, it can be shown that such a matrix b always exists. If there are several such tables, you can output any of them. Please note that you do not have to minimize the number of increments.

Input

Each test contains multiple test cases. The first line contains the number of test cases t (1 ≤ t ≤ 10). Description of the test cases follows.

The first line of each test case contains two integers n, m (1 ≤ n ≤ 100, 1 ≤ m ≤ 100) — the number of rows and columns, respectively.

The following n lines each contain m integers. The j-th integer in the i-th line is a_{i,j} (1 ≤ a_{i,j} ≤ 10^9).

Output

For each case, output n lines each containing m integers. The j-th integer in the i-th line is b_{i,j}.

Example

Input


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


Output


1 2
5 6
7 8
2 1
4 3
2 4
3 2

Note

In all the cases, you can verify that no two adjacent cells have the same value and that b is the same as a with some values incremented by one. 
import java.io.*;
import java.util.*;
import java.util.List;


/**
 * Created by Katushka on 11.03.2020.
 */
public class Main {

    static void sortArray(int[] a) {
        Random random = new Random();

        for (int i = 0; i < a.length; i++) {
            int randomPos = random.nextInt(a.length);
            int t = a[i];
            a[i] = a[randomPos];
            a[randomPos] = t;
        }
        Arrays.sort(a);
    }

    static int[] readArray(int size, InputReader in, boolean subOne) {
        int[] a = new int[size];
        for (int i = 0; i < size; i++) {
            a[i] = in.nextInt() + (subOne ? -1 : 0);
        }
        return a;
    }

    static long[] readLongArray(int size, InputReader in) {
        long[] a = new long[size];
        for (int i = 0; i < size; i++) {
            a[i] = in.nextLong();
        }
        return a;
    }

    static int[] getPartialSums(int[] a) {
        if (a.length == 0) {
            return new int[]{0};
        }
        int[] res = new int[a.length + 1];

        for (int i = 1; i <= a.length; i++) {
            res[i] = res[i - 1] + a[i - 1];
        }

        return res;
    }


    public static void main(String[] args) throws FileNotFoundException {
        long start = System.currentTimeMillis();

//        InputReader in = new InputReader(new FileInputStream("input.txt"));
//        PrintWriter out = new PrintWriter(new BufferedOutputStream(new FileOutputStream("skicourse.out")));

        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

        int t = in.nextInt();
        for (int ii = 0; ii < t; ii++) {
            int n = in.nextInt();
            int m = in.nextInt();
            int[][] a = new int[n][m];
            for (int i = 0; i < n; i++) {
                a[i] = readArray(m, in, false);
            }

            for (int i = 0; i <n;i++) {
                for (int j = 0; j < m; j++) {
                    if ((i + j) % 2 == 0 && a[i][j] % 2 != 0) {
                        a[i][j]++;
                    }
                    if ((i + j) % 2 != 0 && a[i][j] % 2 == 0) {
                        a[i][j]++;
                    }
                }
            }

            for (int i = 0; i < n; i++) {
                outputArray(a[i], out);
            }
        }

        out.close();

    }

    private static long solveDummy(int[][] tree, int[][] costs, int n) {
        List<Integer> leaves = new ArrayList<>();
        int[] parents = new int[n];
        Arrays.fill(parents, -1);
        int[] costToParent = new int[n];
        for (int i = 0; i < tree.length; i++) {
            if (tree[i] == null) {
                leaves.add(i);
            } else {
                parents[tree[i][0]] = i;
                parents[tree[i][1]] = i;

                costToParent[tree[i][0]] = costs[i][0];
                costToParent[tree[i][1]] = costs[i][1];
            }
        }

        List<List<Integer>> perms = getPerms(leaves.size());
        long ans = Long.MAX_VALUE;
        for (int i = 0; i < perms.size(); i++) {
            ans = Math.min(ans, getMaxPath(perms.get(i), leaves, parents, costToParent));
        }

        return ans;
    }

    private static long getMaxPath(List<Integer> perm, List<Integer> leaves, int[] parents, int[] costToParent) {
        int[] visited = new int[parents.length];
        int start = leaves.get(perm.get(0));
        while (parents[start] != -1) {
            visited[start] += 1;
            start = parents[start];
        }

        int end = leaves.get(perm.get(perm.size()-1));
        while (parents[end] != -1) {
            visited[end] += 1;
            end = parents[end];
        }

        long max = 0;
        for (int i = 0; i < perm.size() - 1; i++) {
            int leaf = leaves.get(perm.get(i));
            int next = leaves.get(perm.get(i + 1));

            List<Integer> p1 = new ArrayList<>();
            List<Integer> p2 = new ArrayList<>();

            p1.add(leaf);
            p2.add(next);

            while (parents[leaf] != -1) {
                leaf = parents[leaf];
                p1.add(leaf);
            }

            while (parents[next] != -1) {
                next = parents[next];
                p2.add(next);
            }

            int k1 = p1.size() - 1;
            int k2 = p2.size() - 1;
            while (p1.get(k1).equals(p2.get(k2))) {
                k1--;
                k2--;
            }

            long pathCost = 0;

            for (int j = 0; j <= k1; j++) {
                pathCost += costToParent[p1.get(j)];
                visited[p1.get(j)] += 1;
            }

            for (int j = 0; j <= k2; j++) {
                pathCost += costToParent[p2.get(j)];
                visited[p2.get(j)] += 1;
            }

            max = Math.max(max, pathCost);


        }

        for (int i = 1; i < visited.length; i++) {
            if (visited[i] != 2) {
                return Long.MAX_VALUE;
            }
        }
        return max;
    }



    static int binSearchRight(List<Long> list, long key, int start, int end) {
        int l = start - 1;
        int r = end;
        while (l < r - 1) {
            int m = (l + r) / 2;
            if (list.get(m).compareTo(key) <= 0) {
                l = m;
            } else {
                r = m;
            }
        }
        return l;
    }


    public static List<List<Integer>> getPerms(int n) {
        Set<Integer> notUsed = new TreeSet<>();
        for (int i = 0; i < n; i++) {
            notUsed.add(i);
        }
        ArrayList<List<Integer>> perms = getPerms(n, notUsed);
        for (List<Integer> perm : perms) {
            Collections.reverse(perm);
        }
        return perms;
    }

    public static ArrayList<List<Integer>> getPerms(int n, Set<Integer> notUsed) {
        if (n == 0) {
            return new ArrayList<>();
        }

        if (n == 1) {
            ArrayList<List<Integer>> res = new ArrayList<>();
            res.add(new ArrayList<>());
            res.get(0).add(notUsed.iterator().next());
            return res;
        }

        ArrayList<List<Integer>> res = new ArrayList<>();
        for (Integer num : notUsed) {
            TreeSet<Integer> s = new TreeSet<>(notUsed);
            s.remove(num);
            List<List<Integer>> resChild = getPerms(n - 1, s);
            for (List<Integer> nums : resChild) {
                nums.add(num);
            }
            res.addAll(resChild);
        }

        return res;
    }


    private static void outputArray(int[] ans, PrintWriter out) {
        StringBuilder str = new StringBuilder();
        for (int i = 0; i < ans.length; i++) {
            long an = ans[i];
            str.append(an).append(' ');
        }
        out.println(str);
        out.flush();
    }

    private static void outputArray(List<Integer> ans, PrintWriter out) {
        StringBuilder str = new StringBuilder();
        for (long an : ans) {
            str.append(an).append(' ');
        }
        out.println(str);
        out.flush();
    }


    private static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextString() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public char nextChar() {
            return next().charAt(0);
        }

        public String nextWord() {
            return next();
        }

        private List<Integer>[] readTree(int n) {
            List<Integer>[] result = new ArrayList[n];
            for (int i = 0; i < n; i++) {
                result[i] = new ArrayList<>();
            }
            for (int i = 0; i < n - 1; i++) {
                int u = nextInt() - 1;
                int v = nextInt() - 1;
                result[u].add(v);
                result[v].add(u);
            }
            return result;
        }

    }
}