require 'set'
def scan_field f
  loc_dic = {}
  f.each_with_index {|row, rowi|
    row.each_with_index {|v, coli|
      loc_dic[v] = (loc_dic[v] || [[INF, INF], [-INF, -INF]]).zip([:min, :max]).map {|(pos, p)| pos.zip([rowi, coli]).map(&p) }  unless v == '.'
    }
  }

  remain = Set.new loc_dic.keys
  unsafe = false
  until remain.empty?
    before_remain = remain.dup
    remain.each {|v|
      case scan_object f, loc_dic[v], v, remain
      when :safe
        remain.delete v
      when :unsafe
        return :unsafe
      end
    }
    return :unsafe if remain == before_remain
  end
  :safe
end

def scan_object f, loc, expect, remain
  row_range = loc[0][0]..loc[1][0]
  col_range = loc[0][1]..loc[1][1]
  row_range.each {|rowi|
    col_range.each {|coli|
      v = f[rowi][coli]
      return :unsafe if v == '.'
      return :indeterminate if v != expect && remain.include?(v)
    }
  }
  return :safe
end

INF = 2 << 32
gets.to_i.times {
  h, w = gets.split(' ').map(&:to_i)
  f = h.times.map { gets.chomp.each_char.to_a }
  puts(scan_field(f) == :safe ? 'SAFE' : 'SUSPICIOUS')
}