#include <bits/stdc++.h>

using namespace std;

int main()
{
	int T;
	scanf("%d", &T);

	while (T--){
		int H, W;
		char m[64][64];

		scanf("%d %d", &H, &W);

		for (int i = 1; i <= H; i++){
			scanf("%s", &m[i][1]);
		}

		for (int t = 0; t < 7; t++){
			int ct[27][64][64];

			memset(ct, 0, sizeof(ct));

			for (int ch = 26; ch >= 0; ch--){
				int top, left, down, right;
				top = left = down = right = -1;
				char alpha = (ch == 26 ? '?' : 'A' + ch);

				for (int i = 1; i <= H; i++){
					for (int j = 1; j <= W; j++){
						ct[ch][i][j] = (alpha == m[i][j]) + ct[ch][i - 1][j] + ct[ch][i][j - 1] - ct[ch][i - 1][j - 1];

						if (alpha == m[i][j]){
							if (top   == -1 ||   top > i) top = i;
							if (left  == -1 ||  left > j) left = j;
							if (down  == -1 ||  down < i) down = i;
							if (right == -1 || right < j) right = j;
						}
					}
				}

				if (top == -1 || ch == 26) continue;
				int cnt = ct[ch][down][right] - ct[ch][down][left - 1] - ct[ch][top - 1][right] + ct[ch][top - 1][left - 1]
						+ ct[26][down][right] - ct[26][down][left - 1] - ct[26][top - 1][right] + ct[26][top - 1][left - 1];

				if (cnt == (down - top + 1) * (right - left + 1)){
					for (int i = top; i <= down; i++){
						for (int j = left; j <= right; j++){
							m[i][j] = '?';
						}
					}
					memset(ct[26], 0, sizeof(ct[26]));
				}
			}
		}

		bool safe = true;
		for (int i = 1; i <= H; i++){
			for (int j = 1; j <= W; j++){
				safe &= !isalpha(m[i][j]);
			}
		}

		printf("%s\n", safe ? "SAFE" : "SUSPICIOUS");
	}

	return (0);
}