#include <iostream>
#include <vector>
#include <array>
#include <string>
#include <map>
#include <cmath>
using namespace std;

int main() {
    int n;
    cin >> n;
    while(n--) {
        int w, h;
        cin >> h >> w;
        vector<string> v(h);
        for(int i=0; i<h; ++i) {
            cin >> v[i];
        }
        map<char, int> L, R, T, B;
        for(int i=0; i<h; ++i) {
            for(int j=0; j<w; ++j) {
                char c = v[i][j];
                if(c == '.') {
                    continue;
                }
                if(L.count(c) == 0) {
                    L[c] = R[c] = j;
                    T[c] = B[c] = i;
                } else {
                    L[c] = min(L[c], j);
                    R[c] = max(R[c], j);
                    T[c] = min(T[c], i);
                    B[c] = max(B[c], i);
                }
            }
        }
        // order[i][j] := j is on i
        array<array<bool, 26>, 26> order;
        for(int i=0; i<26; ++i) {
            for(int j=0; j<26; ++j) {
                order[i][j] = false;
            }
        }
        bool ok = true;
        for(auto p : L) {
            char c = p.first;
            int l = p.second, r = R[c], t = T[c], b = B[c];
            for(int i=t; i<=b; ++i) {
                for(int j=l; j<=r; ++j) {
                    if(v[i][j] == '.') {
                        ok = false;
                    } else if(v[i][j] != c) {
                        order[c-'A'][v[i][j] - 'A'] = true;
                    }
                }
            }
        }
        for(int k=0; k<26; ++k) {
            for(int i=0; i<26; ++i) {
                for(int j=0; j<26; ++j) {
                    order[i][j] |= order[i][k] & order[k][j];
                }
            }
        }
        for(int i=0; i<26; ++i) {
            for(int j=0; j<26; ++j) {
                if(order[i][j] && order[j][i]) {
                    ok = false;
                }
            }
        }
        cout << (ok ? "SAFE" : "SUSPICIOUS") << endl;
    }
}
