#include <bits/stdc++.h>
using namespace std;
const double eqs = 1e-8;
const long long max_ = 1e6 + 7;
const long long mod = 10000007;
const long long inf = 2e9 + 7;
const long long INF = 2e18 + 7;
inline long long read() {
  long long s = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = s * 10 + ch - '0';
    ch = getchar();
  }
  return s * f;
}
inline void write(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
long long vis[107][107];
char S[107];
struct kk {
  vector<pair<long long, long long> > xy;
} ans[max_];
long long ansn = 0;
long long T, N, M;
inline void Cal(long long i, long long j, long long &Lcx, long long &Lcy) {
  for (long long X = i - 1; X <= i; X++) {
    for (long long Y = j - 1; Y <= j; Y++) {
      if (X >= 1 && Y >= 1) {
        Lcx = X, Lcy = Y;
        return;
      }
    }
  }
}
long long tv[200][200];
signed main() {
  cin >> T;
  while (T--) {
    memset(vis, 0, sizeof(vis));
    N = read();
    M = read();
    for (long long i = 1; i <= N; i++) {
      cin >> S + 1;
      for (long long j = 1; j <= M; j++) {
        tv[i][j] = vis[i][j] = S[j] - '0';
      }
    }
    pair<long long, long long> tou;
    ansn = 0;
    for (long long i = 1; i <= N; i++) {
      for (long long j = 1; j <= M; j++) {
        if (!vis[i][j]) continue;
        long long Lcx, Lcy;
        Cal(i, j, Lcx, Lcy);
        for (long long X = Lcx; X <= Lcx + 1; X++) {
          for (long long Y = Lcy; Y <= Lcy + 1; Y++) {
            if (X == i && Y == j) continue;
            ansn++;
            ans[ansn].xy.clear();
            for (long long XX = Lcx; XX <= Lcx + 1; XX++) {
              for (long long YY = Lcy; YY <= Lcy + 1; YY++) {
                if (XX == X && YY == Y) continue;
                ans[ansn].xy.push_back(make_pair(XX, YY));
              }
            }
          }
        }
        vis[i][j] ^= 1;
      }
    }
    cout << ansn << "\n";
    for (long long i = 1; i <= ansn; i++) {
      for (auto pa : ans[i].xy) {
        cout << pa.first << " " << pa.second << " ";
      }
      puts("");
    }
  }
  return 0;
}
