#include <bits/stdc++.h>
using namespace std;
bool next(pair<long long, long long> prev, pair<long long, long long> curr,
          bool hor, bool ver, vector<string> &s) {
  long long cha1 = s[prev.first][prev.second];
  if (hor) {
    if (prev.first == curr.first) {
      bool p = true;
      long long y1 = prev.second;
      long long y2 = curr.second;
      for (long long i = y1 + 1; i <= y2 - 1; i++) {
        long long cha2 = s[prev.first][i];
        if (cha2 == '.' || cha2 < cha1) {
          p = false;
          break;
        }
      }
      if (p) {
        return true;
      }
    }
  }
  if (ver) {
    if (prev.second == curr.second) {
      bool p = true;
      long long x1 = prev.first;
      long long x2 = curr.first;
      for (long long i = x1 + 1; i <= x2 - 1; i++) {
        long long cha2 = s[i][prev.second];
        if (cha2 == '.' || cha2 < cha1) {
          p = false;
          break;
        }
      }
      if (p) {
        return true;
      }
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long T;
  cin >> T;
  while (T--) {
    long long n, m;
    cin >> n >> m;
    vector<string> s(n, "");
    for (long long i = 0; i < n; i++) cin >> s[i];
    vector<vector<pair<long long, long long> > > a(
        26, vector<pair<long long, long long> >());
    bool exists = false;
    long long ind1 = -1;
    long long ind2 = -1;
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < m; j++) {
        if (s[i][j] != '.') {
          exists = true;
          a[s[i][j] - 'a'].push_back(make_pair(i, j));
        }
      }
    }
    bool p = true;
    vector<pair<long long, long long> > ans;
    long long c = 0;
    long long c1 = 25;
    for (; c1 >= 0 && exists; c1--) {
      if (!a[c1].empty()) {
        ind1 = a[c1][0].first;
        ind2 = a[c1][0].second;
        break;
      }
    }
    for (; c <= c1 && p && exists; c++) {
      if (a[c].empty()) {
        ans.push_back(make_pair(ind1, ind2));
        ans.push_back(make_pair(ind1, ind2));
      } else {
        {
          bool ver = true;
          bool hor = true;
          if (a[c].size() > 1) {
            pair<long long, long long> a1 = a[c][0];
            pair<long long, long long> a2 = a[c][1];
            if (a1.first == a2.first) {
              ver = false;
            }
            if (a1.second == a2.second) {
              hor = false;
            }
          }
          for (long long i = 1; i < a[c].size(); i++) {
            pair<long long, long long> a1 = a[c][i - 1];
            pair<long long, long long> a2 = a[c][i];
            if (!next(a1, a2, hor, ver, s)) {
              p = false;
              break;
            }
          }
          ans.push_back(a[c][0]);
          ans.push_back(a[c].back());
        }
      }
    }
    if (p) {
      cout << "YES\n";
      cout << ans.size() / 2 << endl;
      for (long long i = 0; i < ans.size(); i += 2) {
        cout << ans[i].first + 1 << " " << ans[i].second + 1 << " "
             << ans[i + 1].first + 1 << " " << ans[i + 1].second + 1 << endl;
      }
    } else
      cout << "NO\n";
  }
}
