#include <bits/stdc++.h>   using namespace std;   template <class T>   using min_pq = priority_queue<T, vector<T>, greater<T>>;   const int MAXN = 1e5 + 10, MAXQ = 3e5 + 10, MAXL = 20, ALP = 26, MOD = 1e9 + 7,             MAXK = 17, INF = 1e9 + 10, MAXA = 30, MAXB = 24, MAXBB = (1 << MAXB);   const string no =  NO n , yes =  YES n ;   const int hA[4] = {1, 0, -1, 0}, kA[4] = {0, 1, 0, -1};   void solve() {     int n, m;     cin >> n >> m;     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         int a;         cin >> a;         if ((a & 1) != ((i + j) & 1)) a++;         cout << a <<    ;       }       cout <<   n ;     }   }   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     int t = 1;     cin >> t;     while (t--) solve();   }   