Problem: This is the easy version of the problem. The difference between the versions is in the number of possible operations that can be made. You can make hacks if and only if you solved both versions of the problem.

You are given a binary table of size n × m. This table consists of symbols 0 and 1.

You can make such operation: select 3 different cells that belong to one 2 × 2 square and change the symbols in these cells (change 0 to 1 and 1 to 0).

Your task is to make all symbols in the table equal to 0. You are allowed to make at most 3nm operations. You don't need to minimize the number of operations.

It can be proved that it is always possible.

Input

The first line contains a single integer t (1 ≤ t ≤ 5000) — the number of test cases. The next lines contain descriptions of test cases.

The first line of the description of each test case contains two integers n, m (2 ≤ n, m ≤ 100).

Each of the next n lines contains a binary string of length m, describing the symbols of the next row of the table.

It is guaranteed that the sum of nm for all test cases does not exceed 20000.

Output

For each test case print the integer k (0 ≤ k ≤ 3nm) — the number of operations.

In the each of the next k lines print 6 integers x_1, y_1, x_2, y_2, x_3, y_3 (1 ≤ x_1, x_2, x_3 ≤ n, 1 ≤ y_1, y_2, y_3 ≤ m) describing the next operation. This operation will be made with three cells (x_1, y_1), (x_2, y_2), (x_3, y_3). These three cells should be different. These three cells should belong into some 2 × 2 square.

Example

Input


5
2 2
10
11
3 3
011
101
110
4 4
1111
0110
0110
1111
5 5
01011
11001
00010
11011
10000
2 3
011
101


Output


1
1 1 2 1 2 2
2 
2 1 3 1 3 2
1 2 1 3 2 3
4
1 1 1 2 2 2 
1 3 1 4 2 3
3 2 4 1 4 2
3 3 4 3 4 4
4
1 2 2 1 2 2 
1 4 1 5 2 5 
4 1 4 2 5 1
4 4 4 5 3 4
2
1 3 2 2 2 3
1 2 2 1 2 2

Note

In the first test case, it is possible to make only one operation with cells (1, 1), (2, 1), (2, 2). After that, all symbols will be equal to 0.

In the second test case:

  * operation with cells (2, 1), (3, 1), (3, 2). After it the table will be: 
    
          
    011  
    001  
    000  
    

  * operation with cells (1, 2), (1, 3), (2, 3). After it the table will be: 
    
          
    000  
    000  
    000  
    




In the fifth test case:

  * operation with cells (1, 3), (2, 2), (2, 3). After it the table will be: 
    
          
    010  
    110  
    

  * operation with cells (1, 2), (2, 1), (2, 2). After it the table will be: 
    
          
    000  
    000  
    

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
void printv(vector<long long int> v) {
  long long int sz = v.size();
  for (long long int i = 0; i < sz; i++) {
    if (i == sz - 1)
      cout << v[i] << "\n";
    else
      cout << v[i] << " ";
  }
}
void input(long long int a[], long long int sz) {
  for (long long int i = 0; i < sz; i++) cin >> a[i];
}
void print(long long int a[], long long int sz) {
  for (long long int i = 0; i < sz; i++) {
    if (i == sz - 1)
      cout << a[i] << "\n";
    else
      cout << a[i] << " ";
  }
}
long long int dx1[] = {1, 1, 0, -1, -1, -1, 0, 1};
long long int dy1[] = {0, 1, 1, 1, 0, -1, -1, -1};
long long int dx2[] = {1, 0, -1, 0};
long long int dy2[] = {0, 1, 0, -1};
long long int mul(long long int a, long long int b,
                  long long int p = 1000000007) {
  return ((a % p) * (b % p)) % p;
}
long long int add(long long int a, long long int b,
                  long long int p = 1000000007) {
  return (a % p + b % p) % p;
}
long long int power(long long int x, long long int y,
                    long long int p = 1000000007) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long int modInverse(long long int n, long long int p = 1000000007) {
  return power(n, p - 2, p);
}
long long int ncrMod(long long int n, long long int r,
                     long long int p = 1000000007) {
  if (r == 0) return 1;
  long long int fac[n + 1];
  fac[0] = 1;
  for (long long int i = 1; i <= n; i++) fac[i] = fac[i - 1] * i % p;
  return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) %
         p;
}
bool ispeed2ime(long long int n) {
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
bool isPowerof2(long long int n) {
  while (n > 1) {
    if (n % 2 != 0) {
      return true;
    }
    n /= 2;
  }
  return false;
}
string s[102];
long long int temp;
vector<vector<pair<long long int, long long int>>> sol;
vector<pair<long long int, long long int>> ans;
void solve(int x, int y) {
  long long int zero = 0, one = 0;
  vector<pair<long long int, long long int>> v0, v1;
  if (s[x][y] == '0') {
    zero++;
    v0.push_back(make_pair(x, y));
  } else {
    v1.push_back(make_pair(x, y));
    one++;
  }
  if (s[x + 1][y] == '0') {
    v0.push_back(make_pair(x + 1, y));
    zero++;
  } else {
    v1.push_back(make_pair(x + 1, y));
    one++;
  }
  if (s[x][y + 1] == '0') {
    zero++;
    v0.push_back(make_pair(x, y + 1));
  } else {
    v1.push_back(make_pair(x, y + 1));
    one++;
  }
  if (s[x + 1][y + 1] == '0') {
    v0.push_back(make_pair(x + 1, y + 1));
    zero++;
  } else {
    v1.push_back(make_pair(x + 1, y + 1));
    one++;
  }
  if (zero == 0 and one == 4) {
    temp += 4;
    ans.push_back(make_pair(1, 1));
    ans.push_back(make_pair(1, 2));
    ans.push_back(make_pair(2, 1));
    sol.push_back(ans);
    ans.clear();
    ans.push_back(make_pair(1, 1));
    ans.push_back(make_pair(1, 2));
    ans.push_back(make_pair(2, 2));
    sol.push_back(ans);
    ans.clear();
    ans.push_back(make_pair(2, 2));
    ans.push_back(make_pair(1, 1));
    ans.push_back(make_pair(2, 1));
    sol.push_back(ans);
    ans.clear();
    ans.push_back(make_pair(1, 2));
    ans.push_back(make_pair(2, 1));
    ans.push_back(make_pair(2, 2));
    sol.push_back(ans);
    ans.clear();
  } else if (zero == 1 and one == 3) {
    temp += 1;
    ans.clear();
    for (int i = 0; i < v1.size(); i++) {
      ans.push_back(make_pair(v1[i].first + 1, v1[i].second + 1));
    }
    sol.push_back(ans);
    ans.clear();
  } else if (zero == 2 and one == 2) {
    temp += 2;
    ans.clear();
    for (int i = 0; i < v0.size(); i++) {
      ans.push_back(make_pair(v0[i].first + 1, v0[i].second + 1));
    }
    ans.push_back(make_pair(v1[0].first + 1, v1[0].second + 1));
    sol.push_back(ans);
    ans.clear();
    ans.push_back(make_pair(v1[1].first + 1, v1[1].second + 1));
    for (int i = 0; i < v0.size(); i++) {
      ans.push_back(make_pair(v0[i].first + 1, v0[i].second + 1));
    }
    sol.push_back(ans);
    ans.clear();
  } else if (zero == 3 and one == 1) {
    temp += 3;
    ans.clear();
    for (int i = 0; i < v0.size() - 1; i++) {
      ans.push_back(make_pair(v0[i].first + 1, v0[i].second + 1));
    }
    ans.push_back(make_pair(v1[0].first + 1, v1[0].second + 1));
    sol.push_back(ans);
    ans.clear();
    ans.push_back(make_pair(v0[0].first + 1, v0[0].second + 1));
    ans.push_back(make_pair(v0[2].first + 1, v0[2].second + 1));
    ans.push_back(make_pair(v1[0].first + 1, v1[0].second + 1));
    sol.push_back(ans);
    ans.clear();
    ans.push_back(make_pair(v0[1].first + 1, v0[1].second + 1));
    ans.push_back(make_pair(v1[0].first + 1, v1[0].second + 1));
    ans.push_back(make_pair(v0[2].first + 1, v0[2].second + 1));
    sol.push_back(ans);
    ans.clear();
  }
}
void solve() {
  long long int n, m;
  cin >> n >> m;
  temp = 0;
  sol.clear();
  ans.clear();
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  for (int i = 0; i < n - 1; i++) {
    for (int j = 0; j < m - 1; j++) {
      solve(i, j);
      s[i][j] = '0';
      s[i + 1][j] = '0';
      s[i][j + 1] = '0';
      s[i + 1][j + 1] = '0';
    }
  }
  cout << temp << "\n";
  for (int i = 0; i < sol.size(); i++) {
    for (int j = 0; j < sol[i].size(); j++) {
      cout << sol[i][j].first << " " << sol[i][j].second << " ";
    }
    cout << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}