#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

vector<string> v;
bool ngchars[256];

bool check(int y, int x, int Y, int X, char C) {
	bool out;
	bool in;
	Y++; X++;
	for(int i = y; i < Y; i++) {
		for(int j = x; j < X; j++) {
			if(ngchars[v[i][j]]) {
				return false;
			}
		}
	}
	return true;
}

int main() {
	int n;
	cin >> n;
	for(int iter = 0; iter < n; iter++) {
		int w, h;
		vector<char> cs;
		cin >> h >> w;
		v.clear();
		v.resize(h);
		for(int i = 0; i < h; i++)
			cin >> v[i];
		for(int i = 0; i < 256; i++)
			ngchars[i] = false;
		for(int i = 0; i < v.size(); i++) {
			for(int j = 0; j < v[i].size(); j++) {
				if(v[i][j] != '.') {
					cs.push_back(v[i][j]);
				}
			}
		}
		int x[30], y[30], X[30], Y[30];
		for(int i = 0; i < 30; i++) {
			x[i] = y[i] = 100;
			X[i] = Y[i] = -1;
		}
		for(int i = 0; i < v.size(); i++) {
			for(int j = 0; j < v[i].size(); j++) {
				if(v[i][j] == '.') continue;
				int c;
				c = v[i][j] - 'A';
				x[c] = min(x[c], j);
				X[c] = max(X[c], j);
				y[c] = min(y[c], i);
				Y[c] = max(Y[c], i);
			}
		}

		bool res = false;
		sort(cs.begin(), cs.end());
		cs.erase(unique(cs.begin(), cs.end()), cs.end());
		do {
			for(int i = 0; i < cs.size(); i++)
				ngchars[cs[i]] = true;
			ngchars['.'] = true;
			bool f = true;
			for(int i = 0; i < cs.size(); i++) {
				ngchars[cs[i]] = false;
				int c = cs[i] - 'A';
				if(!check(y[c],x[c],Y[c],X[c],'A'+c)) {
					f = false;
				}
			}
			if(f)
				res = true;
		} while(next_permutation(cs.begin(), cs.end()));
		if(res)
			cout << "SAFE" << endl;
		else
			cout << "SUSPICIOUS" << endl;
	}
}