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.security.SecureRandom;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.InputMismatchException;
import java.util.List;
import java.util.Optional;
import java.util.Random;
import java.util.stream.*;


public class Template {

    // 420 remainder: use long everywhere

    private final static boolean MULTIPLE_TESTS = true;

    private void solve() {
        int n = reader.readInt();
        int m = reader.readInt();
        int[][] a = new int[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                a[i][j] = reader.readInt();
            }
        }

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

        for (int i = 0; i < n; i++) {
            writer.println(a[i]);
        }
    }

    private FastReader reader;
    private FastWriter writer;

    private void run() throws Exception {
        reader = new FastReader();
        writer = new FastWriter();

        int t = MULTIPLE_TESTS ? reader.readInt() : 1;

        for (int testNum = 0; testNum < t; testNum++) {
            solve();
        }

        writer.close();
        reader.close();
    }

    public static void main(String[] args) throws Exception {
        new Template().run();
    }

    private final static boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

    private static class FastWriter implements AutoCloseable {
        @SuppressWarnings(value="all")
        private final static Optional<String> OUTPUT_FILENAME = Optional.empty();

        private final PrintWriter out;

        public FastWriter() throws FileNotFoundException {
            this.out = OUTPUT_FILENAME.isEmpty() ? new PrintWriter(System.out) : new PrintWriter(new File(OUTPUT_FILENAME.get()));
        }

        public <T> void print(T value) {
            out.print(value);
        }

        public <T> void println(T value) {
            out.println(value);
        }

        public <T> void print(List<? extends T> list) {
            for (var it = list.listIterator(); it.hasNext(); ) {
                out.print(it.next());
                if (it.hasNext()) {
                    out.print(' ');
                }
            }
        }

        public <T> void println(List<? extends T> list) {
            print(list);
            out.println();
        }

        public <T> void print(T[] array) {
            for (int i = 0; i < array.length; i++) {
                out.print(array[i]);
                if (i + 1 < array.length) {
                    out.print(' ');
                }
            }
            out.println();
        }

        public <T> void println(T[] array) {
            print(array);
            out.println();
        }

        public void print(int[] array) {
            for (int i = 0; i < array.length; i++) {
                out.print(array[i]);
                if (i + 1 < array.length) {
                    out.print(' ');
                }
            }
            out.println();
        }

        public void println(int[] array) {
            print(array);
        }

        public void print(long[] array) {
            for (int i = 0; i < array.length; i++) {
                out.print(array[i]);
                if (i + 1 < array.length) {
                    out.print(' ');
                }
            }
            out.println();
        }

        public void println(long[] array) {
            print(array);
            out.println();
        }

        public void print(double[] array) {
            for (int i = 0; i < array.length; i++) {
                out.print(array[i]);
                if (i + 1 < array.length) {
                    out.print(' ');
                }
            }
            out.println();
        }

        public void println(double[] array) {
            print(array);
            out.println();
        }

        @Override
        public void close() {
            out.close();
        }
    }

    private static class FastReader implements AutoCloseable {
        private final static String INPUT_FILENAME = "input.txt";

        private final InputStream inputStream;
        private final byte[] buffer = new byte[1024];

        private int bufferLen = 0;
        private int bufferPtr = 0;

        public FastReader() throws FileNotFoundException {
            this.inputStream = ONLINE_JUDGE ? System.in : new FileInputStream(INPUT_FILENAME);
        }

        public int[] readIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++) {
                array[i] = readInt();
            }
            return array;
        }

        public long[] readLongArray(int size) {
            long[] array = new long[size];
            for (int i = 0; i < size; i++) {
                array[i] = readLong();
            }
            return array;
        }

        public double[] readDoubleArray(int size) {
            double[] array = new double[size];
            for (int i = 0; i < size; i++) {
                array[i] = readLong();
            }
            return array;
        }

        public double readDouble() {
            return Double.parseDouble(readToken());
        }

        public String readToken() {
            int b = skip();
            StringBuilder sb = new StringBuilder();
            while (!(isSpaceChar(b))) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

        public int readInt() {
            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 * 10 + (b - '0');
                } else {
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }

        public long readLong() {
            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 * 10 + (b - '0');
                } else {
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }

        public int readByte() {
            if (bufferLen == -1) {
                throw new InputMismatchException();
            }
            if (bufferPtr >= bufferLen) {
                bufferPtr = 0;
                try {
                    bufferLen = inputStream.read(buffer);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (bufferLen <= 0) {
                    return -1;
                }
            }
            return buffer[bufferPtr++];
        }

        public char readChar() {
            return (char) skip();
        }

        private int skip() {
            int b;
            while ((b = readByte()) != -1 && isSpaceChar(b));
            return b;
        }

        private static boolean isSpaceChar(int c) {
            return !(c >= 33 && c <= 126);
        }

        @Override
        public void close() throws Exception {
            inputStream.close();
            bufferPtr = bufferLen;
        }
    }

    private static class Tuple {
        public static <A, B> Tuple2<A, B> of(A first, B second) {
            return new Tuple2<>(first, second);
        }

        public static <A, B> List<Tuple2<A, B>> array(A[] first, B[] second) {
            if (first.length != second.length) {
                throw new RuntimeException(
                        String.format("Can't create tuples array from arrays with different length (%d != %d)",
                                first.length, second.length));
            }
            return IntStream.range(0, first.length)
                    .mapToObj(i -> Tuple.of(first[i], second[i]))
                    .collect(Collectors.toList());
        }

        public static <A, B, C> Tuple3<A, B, C> of(A first, B second, C third) {
            return new Tuple3<>(first, second, third);
        }

        public static <A, B, C> List<Tuple3<A, B, C>> array(A[] first, B[] second, C[] third) {
            if (first.length != second.length || second.length != third.length) {
                throw new RuntimeException(
                        String.format("Can't create tuples array from arrays with different length (%d, %d, %d)",
                                first.length, second.length, third.length));
            }
            return IntStream.range(0, first.length)
                    .mapToObj(i -> Tuple.of(first[i], second[i], third[i]))
                    .collect(Collectors.toList());
        }

        public static <A extends Comparable<A>, B extends Comparable<B>> Comparator<Tuple2<A, B>> tuple2Comparator() {
            return Comparator.comparing((Tuple2<A, B> t) -> t.first).thenComparing(t -> t.second);
        }

        public static <A extends Comparable<A>, B extends Comparable<B>, C extends Comparable<C>> Comparator<Tuple3<A, B, C>> tuple3Comparator() {
            return Comparator.comparing((Tuple3<A, B, C> t) -> t.first).thenComparing(t -> t.second).thenComparing(t -> t.third);
        }

        private static class Tuple2<A, B> extends Tuple {
            public final A first;
            public final B second;

            private Tuple2(A first, B second) {
                this.first = first;
                this.second = second;
            }

            @Override
            public String toString() {
                return "(" + first + ", " + second + ")";
            }
        }

        private static class Tuple3<A, B, C> extends Tuple2<A, B> {
            public final C third;

            private Tuple3(A first, B second, C third) {
                super(first, second);
                this.third = third;
            }

            @Override
            public String toString() {
                return "(" + first + ", " + second + ", " + third + ")";
            }
        }
    }

    private static class Utils {
        private static final Random RANDOM = new SecureRandom();

        public static <T extends Comparable<T>> void sort(T[] array) {
            shuffle(array);
            Arrays.sort(array);
        }

        public static void sort(int[] array) {
            shuffle(array);
            Arrays.sort(array);
        }

        public static void sort(long[] array) {
            shuffle(array);
            Arrays.sort(array);
        }

        public static void sort(double[] array) {
            shuffle(array);
            Arrays.sort(array);
        }

        public static <T> void sort(T[] array, Comparator<T> comparator) {
            shuffle(array);
            Arrays.sort(array, comparator);
        }

        public static <T> void shuffle(T[] array) {
            for (int i = array.length - 1; i > 0; i--) {
                int index = RANDOM.nextInt(i + 1);
                T a = array[index];
                array[index] = array[i];
                array[i] = a;
            }
        }

        public static void shuffle(int[] array) {
            for (int i = array.length - 1; i > 0; i--) {
                int index = RANDOM.nextInt(i + 1);
                int a = array[index];
                array[index] = array[i];
                array[i] = a;
            }
        }

        public static void shuffle(long[] array) {
            for (int i = array.length - 1; i > 0; i--) {
                int index = RANDOM.nextInt(i + 1);
                long a = array[index];
                array[index] = array[i];
                array[i] = a;
            }
        }

        public static void shuffle(double[] array) {
            for (int i = array.length - 1; i > 0; i--) {
                int index = RANDOM.nextInt(i + 1);
                double a = array[index];
                array[index] = array[i];
                array[i] = a;
            }
        }

        public static <T extends Comparable<T>> void sort(List<T> list) {
            Collections.shuffle(list);
            Collections.sort(list);
        }

        public static <T> void sort(List<T> list, Comparator<T> comparator) {
            Collections.shuffle(list);
            list.sort(comparator);
        }

        public static int randomInt(int fromIncluded, int toExcluded) {
            return fromIncluded + RANDOM.nextInt(toExcluded - fromIncluded);
        }

        public static Integer[] generify(int[] a) {
            return IntStream.of(a).boxed().toArray(Integer[]::new);
        }

        public static Long[] generify(long[] a) {
            return LongStream.of(a).boxed().toArray(Long[]::new);
        }

        public static Double[] generify(double[] a) {
            return DoubleStream.of(a).boxed().toArray(Double[]::new);
        }
    }
}
