#include <stdio.h>
#include <map>
#include <algorithm>

#define rep(i, n) for(int i=0; i<(int)(n); i++)
using namespace std;

int used[8];
char fie[50][50];
map<char, int> dict;
int minx[7], maxx[7], miny[7], maxy[7];
int c;

int H, W;

bool ok(int d) {
	if(d==c) return true;
	rep(i, c) if(used[i]==0) {
		used[i] = 1;
		bool f = true;
		for(int x=minx[i]; x<=maxx[i]; x++) {
			for(int y=miny[i]; y<=maxy[i]; y++) {
				if(used[dict[fie[x][y]]]==0) {
					f = false;
					goto loop_end;
				}
			}
		}
	loop_end:
		if(f) f = ok(d+1);
		used[i] = 0;
		if(f) return true;
	}
	return false;
}

int main()
{
	int N;
	scanf("%d", &N);
	rep(q, N) {
		dict.clear();
		fill_n(used, 8, 0);
		scanf("%d%d", &H, &W);
		c=0;
		rep(i, H) rep(j, W) {
			scanf(" %c", fie[j]+i);
			if(fie[j][i]!='.') {
				if(dict.find(fie[j][i])==dict.end()) {
					minx[c] = maxx[c] = j;
					miny[c] = maxy[c] = i;
					dict[fie[j][i]] = c++;
				}
				int d = dict[fie[j][i]];
				minx[d] = min(minx[d], j);
				maxx[d] = max(maxx[d], j);
				miny[d] = min(miny[d], i);
				maxy[d] = max(maxy[d], i);
			}
		}
		dict['.'] = 7;
		printf("%s\n", ok(0) ? "SAFE" : "SUSPICIOUS");
	}
	return 0;
}