n = gets.to_i
n.times do
    h, w = gets.split.map(&:to_i)
    f = h.times.map{gets.chomp}
    keys = Array.new
    f.each do |r|
        r.each_char do |c|
            keys.push(c) if !keys.include?(c) && c != "."
        end
    end
    if keys.empty?
        puts "SAFE"
        next
    end
    b = true
    keys.permutation(keys.size) do |p|
        b = true
        done = Array.new
        p.each do |c|
            t = l = 100
            b = r = -1
            f.each_with_index do |row, i|
                row.each_char.with_index do |ch, j|
                    if ch == c
                        t = i if i < t
                        l = j if j < l
                        b = i if i > b
                        r = j if j > r
                    end
                end
            end
            for i in t..b
                for j in l..r
                    if f[i][j] != c && !done.include?(f[i][j])
                        b = false
                    end
                    break if !b
                end
            end
            break if !b
            done.push(c)
        end
        break if b
    end
    puts b ? "SAFE" : "SUSPICIOUS"
end