//#include <bits/stdc++.h>
#include<iostream>
#include<stdio.h>
#include<bitset>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<string.h>
#include<cmath>
#include<utility>
#include<functional>
#include<map>
#include<set>


#define FOR(i, a, b) for( int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for( int i=(a);i>=(b);i--)
#define LFOR(i, a, b) for( long long int i=(a);i<=(b);i++)
#define LRFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000 //2000000000
#define LLINF 1000000000000000000 //9000000000000000000
#define PI 3.14159265358979
#define MAXI 7500000

using namespace std;
typedef long long int ll;
typedef pair< long long int, long long  int> P;


int main(void) {

	int n;

	cin >> n;

	FOR(i, 1, n) {
		int h, w;
		vector<bool> check(27, false);
		
		
		bool ok = true;
		

		cin >> h >> w;

		vector<string> s(h);

		FOR(j, 0, h - 1) {
			cin >> s[j];
		}


		FOR(j, 0, h - 1) {
			FOR(k, 0, w - 1) {
				if (s[j][k] >= 'A'&&s[j][k] <= 'Z') {
					check[s[j][k] - 'A'+1] = true;
				}
			}
		}

		while (ok == true) {
			ok = false;
			vector<bool> flag(27, false);
			vector<int> xf(27, -1);
			vector<int> xl(27, -1);
			vector<int> yf(27, -1);
			vector<int> yl(27, -1);
			//cout << 'c' << endl;
			FOR(j, 1, 26) {
				if (check[j] == false) {
					continue;
				}
				FOR(k, 0, h - 1) {
					FOR(l, 0, w - 1) {
						if (s[k][l] == j - 1 + 'A') {
							yf[j] = k;
							break;
						}
					}
					if (yf[j] != -1) {
						break;
					}

				}
				RFOR(k, h - 1, 0) {
					RFOR(l, w - 1, 0) {
						if (s[k][l] == j - 1 + 'A') {
							yl[j] = k;
							break;
						}
					}
					if (yl[j] != -1) {
						break;
					}
				}
				FOR(k, 0, w - 1) {
					FOR(l, 0, h - 1) {
						if (s[l][k] == j - 1 + 'A') {
							xf[j] = k;
							break;
						}
					}
					if (xf[j] != -1) {
						break;
					}

				}
				RFOR(k, w - 1, 0) {
					RFOR(l, h - 1, 0) {
						if (s[l][k] == j - 1 + 'A') {
							xl[j] = k;
							break;
						}
					}
					if (xl[j] != -1) {
						break;
					}
				}

				

				//cout << 'd' << endl;
				FOR(k, 0, h - 1) {
					FOR(l, 0, w - 1) {
						//cout << k << " " << l << endl;
						if (l >= xf[j] && l <= xl[j] && k >= yf[j] && k <= yl[j]) {
							if (s[k][l] != 'A' + j - 1&&s[k][l]!='o') {
								goto end;
							}

						}
						else {
							if (s[k][l] == 'A' + j - 1) {
								goto end;
							}
						}
					}
					if (k == h - 1) {
						flag[j] = true;
					}
				}

			end:;

			}

			//cout << 'e' << endl;
			FOR(j, 1, 26) {
				if (flag[j] == true) {
					FOR(k, 0, h - 1) {
						FOR(l, 0, w - 1) {
							if (s[k][l] == 'A' + j - 1) {
								s[k][l] = 'o';
							}
						}
					}
				}
			}
			//cout << 'f' << endl;

			FOR(j, 1, 26) {
				if (flag[j] == true) {
					ok = true;
					check[j] = false;
				}
			}


			/*cout << endl;
			FOR(j, 0, h - 1) {
				FOR(k, 0, w - 1) {
					cout << s[j][k];
				}
				cout << endl;
			}
			cout << endl;*/
		}
		
		ok = true;;
		FOR(j, 1, 26) {
			if (check[j] == true) {
				ok = false;
			}
		}

		if (ok) {
			cout << "SAFE" << endl;
		}
		else {
			cout << "SUSPICIOUS" << endl;
		}
	}

	
	return 0;
}


Measured memory_bytes: 3060