#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long t, n, m, i, j, k, temp, flag, shesh, bal;
  cin >> t;
  while (t--) {
    cin >> n >> m;
    cin.ignore();
    string s[n];
    map<char, vector<pair<long long, long long> > > mp;
    for (i = 0; i < n; i++) {
      cin >> s[i];
      for (j = 0; j < s[i].size(); j++) {
        if (s[i][j] != '.') {
          mp[s[i][j]].push_back({i, j});
        }
      }
    }
    vector<pair<pair<long long, long long>, pair<long long, long long> > > ans;
    char ch;
    for (ch = 'z', flag = 0, shesh = 0; ch >= 'a' && !shesh; ch--) {
      if (flag) {
        if (!mp[ch].size()) {
          ans.push_back(ans[ans.size() - 1]);
          continue;
        }
        sort(mp[ch].begin(), mp[ch].end());
        long long a = mp[ch][0].first, b = mp[ch][0].second;
        for (i = b, temp = 0, bal = 0; i <= mp[ch][mp[ch].size() - 1].second;
             i++) {
          if (s[a][i] < ch) {
            temp++;
            break;
          } else if (s[a][i] == ch) {
            bal++;
          }
        }
        if (!temp && bal == mp[ch].size()) {
          ans.push_back({{mp[ch][0].first, mp[ch][0].second},
                         {mp[ch][mp[ch].size() - 1].first,
                          mp[ch][mp[ch].size() - 1].second}});
        } else {
          for (i = a, temp = 0, bal = 0; i <= mp[ch][mp[ch].size() - 1].first;
               i++) {
            if (s[i][b] < ch) {
              temp++;
              break;
            } else if (s[i][b] == ch) {
              bal++;
            }
          }
          if (!temp && bal == mp[ch].size()) {
            ans.push_back({{mp[ch][0].first, mp[ch][0].second},
                           {mp[ch][mp[ch].size() - 1].first,
                            mp[ch][mp[ch].size() - 1].second}});
          } else {
            shesh++;
            break;
          }
        }
      } else {
        if (!mp[ch].size())
          continue;
        else {
          flag++;
          sort(mp[ch].begin(), mp[ch].end());
          long long a = mp[ch][0].first, b = mp[ch][0].second;
          for (i = 1, temp = 0; i < mp[ch].size(); i++) {
            if ((mp[ch][i].first != a || b + i != mp[ch][i].second)) {
              temp++;
              break;
            }
          }
          if (!temp) {
            ans.push_back({{mp[ch][0].first, mp[ch][0].second},
                           {mp[ch][mp[ch].size() - 1].first,
                            mp[ch][mp[ch].size() - 1].second}});
          } else {
            for (i = 1, temp = 0; i < mp[ch].size(); i++) {
              if ((mp[ch][i].first != a + i || b != mp[ch][i].second)) {
                temp++;
                break;
              }
            }
            if (!temp) {
              ans.push_back({{mp[ch][0].first, mp[ch][0].second},
                             {mp[ch][mp[ch].size() - 1].first,
                              mp[ch][mp[ch].size() - 1].second}});
            } else {
              shesh++;
              break;
            }
          }
        }
      }
    }
    if (shesh) {
      cout << "NO\n";
    } else {
      cout << "YES\n" << ans.size() << "\n";
      while (ans.size()) {
        cout << ans[ans.size() - 1].first.first + 1 << " "
             << ans[ans.size() - 1].first.second + 1 << " "
             << ans[ans.size() - 1].second.first + 1 << " "
             << ans[ans.size() - 1].second.second + 1 << "\n";
        ans.pop_back();
      }
    }
  }
}
