require 'set'

n = gets.to_i
n.times do
	h, w = gets.split.map(&:to_i)
	a = (1..h).map { gets.chomp }
	chars = a.join.split("").uniq - [?.]
	prior = {}
	
	safe = true
	catch :exit do
		chars.each do |c|
			prior[c] = Set.new
			y1 = a.index {|row| row =~ /#{c}/}
			y2 = a.rindex {|row| row =~ /#{c}/}
			x1 = a.map {|row| (row =~ /#{c}/) || w}.min
			x2 = a.map {|row| w - 1 - (row.reverse =~ /#{c}/ || w)}.max
			(y1..y2).each do |i|
				(x1..x2).each do |j|
					if a[i][j] == ?.
						safe = false
						throw :exit
					elsif a[i][j] != c
						prior[c] << a[i][j]
					end
				end
			end
		end
	end

	if !safe
		puts 'SUSPICIOUS'
		next
	end

	safe = chars.empty? ? true : false
	chars.permutation(chars.size) do |perm|
		order = {}
		perm.each.with_index {|c, i| order[c] = i}
		
		if chars.all? {|c| prior[c].all?{|p| order[p] < order[c]}}
			safe = true
			break
		end
	end
	puts safe ? 'SAFE' : 'SUSPICIOUS'
end