#include <iostream>
#include <algorithm>
#include <string>
#include <vector>

using namespace std;

#define rep(i, n) for (int i = 0; i < int(n); ++i)
#define all(c) (c).begin(), (c).end()

template<typename T>
inline bool chmin(T& t, T f) { if (t <= f) return false; t = f; return true; }

template<typename T>
inline bool chmax(T& t, T f) { if (t >= f) return false; t = f; return true; }

bool valid(vector<string>& sc, vector<vector<int>>& range, string& bagg) {
    int used = 0;
    rep(k, bagg.size()) {
        int l = bagg[k] - 'A';
        used |= 1 << l;
        for (int i = range[l][0]; i <= range[l][1]; ++i) {
            for (int j = range[l][2]; j <= range[l][3]; ++j) {
                if (sc[i][j] == '.' || !(used >> (sc[i][j] - 'A') & 1)) return false;
            }
        }
    }
    return true;
}

char const *check(int H, int W, vector<string>& sc) {
    int used = 0;
    vector<vector<int>> range(26, {H, 0, W, 0});
    string bagg = "";
    rep(i, H) rep(j, W) if (sc[i][j] != '.') {
        int l = sc[i][j] - 'A';
        if (used >> l & 1) {
            chmin(range[l][0], i);
            chmax(range[l][1], i);
            chmin(range[l][2], j);
            chmax(range[l][3], j);
        }
        else {
            used |= 1 << l;
            bagg += sc[i][j];
            range[l][0] = range[l][1] = i;
            range[l][2] = range[l][3] = j;
        }
    }
    sort(all(bagg));
    do {
        if (valid(sc, range, bagg)) return "SAFE";
    } while (next_permutation(all(bagg)));
    return "SUSPICIOUS";
}

int main() {
    int n;
    cin >> n;
    while (n--) {
        int H, W;
        cin >> H >> W;
        vector<string> sc(H);
        for (auto& e: sc) cin >> e;
        cout << check(H, W, sc) << endl;
    }
    return 0;
}