#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ll long long
#define lld long double
#ifdef DEBUG
#define line() cout << "[" << __LINE__ << "] ";
#define dump(i) cout << #i ": " << i << " ";
#define dumpl(i) cout << #i ": " << i << endl;
#else
#define ALL(x) x.begin(), x.end()
#define line(i)
#define dump(i)
#define dumpl(i)
#endif
using namespace std;

inline int toInt(string s)
{
    int v;
    istringstream sin(s);
    sin >> v;
    return v;
}
struct xy
{
    int r, l, h, d;
};
int main()
{
    int n;
    cin >> n;
    int h, w;
    rep(y, n)
    {

        cin >> h >> w;
        string board[h];
        rep(i, h)
        {
            cin >> board[i];
        }
        bool okflag = false;
        rep(z, 8)
        {
            map<char, struct xy> mp;
            map<char, bool> mp2;
            rep(i, h)
            {
                rep(j, w)
                {
                    if (board[i][j] != '.' && board[i][j] != '*')
                    {
                        if (mp2[board[i][j]] == false)
                        {
                            mp[board[i][j]].r = -1;
                            mp[board[i][j]].l = 50;
                            mp[board[i][j]].h = 50;
                            mp[board[i][j]].d = -1;
                            mp2[board[i][j]] = true;
                        }
                        mp[board[i][j]].r = max(mp[board[i][j]].r, j);
                        mp[board[i][j]].l = min(mp[board[i][j]].l, j);
                        mp[board[i][j]].h = min(mp[board[i][j]].h, i);
                        mp[board[i][j]].d = max(mp[board[i][j]].d, i);
                    }
                }
            }
            // cerr << mp.size() << endl;
            if (mp.size() == 0)
            {
                okflag = true;
            }

            for (auto alph : mp)
            {
                bool flag = true;
                rep(i, alph.second.h, alph.second.d + 1)
                {
                    rep(j, alph.second.l, alph.second.r + 1)
                    {
                        if (board[i][j] == alph.first || board[i][j] == '*')
                            continue;
                        else
                            flag = false;
                    }
                }
                // cout << 'h' << mp['W'].h << endl;
                // cout << 'd' << mp['W'].d << endl;
                // cout << 'r' << mp['W'].r << endl;
                // cout << 'l' << mp['W'].l << endl;

                if (flag)
                {
                    rep(i, alph.second.h, alph.second.d + 1)
                    {
                        rep(j, alph.second.l, alph.second.r + 1)
                        {
                            board[i][j] = '*';
                        }
                    }
                    break;
                }
            }
            mp.clear();
            mp2.clear();
        }
        if (okflag)
        {
            cout << "SAFE" << endl;
        }
        else
        {
            cout << "SUSPICIOUS" << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 3216