n, m = gets.split.map(&:to_i)
w = (1..m).map {gets.chomp.split("")}.transpose.map {|a| a.count(?W)}
min_error = error = w.inject(:+)
ans = 0
(0..n-1).each do |i|
    error += m - 2 * w[i]
    if error < min_error
        min_error = error
        ans = i + 1
    end
end
puts "#{ans} #{ans + 1}"
