H, W = gets.split.map(&:to_i) S = H.times.map { gets.chomp } counter_y = Array.new(H, 0) counter_x = Array.new(W, 0) H.times do |y| W.times do |x| next if S[y][x] == '-' counter_y[y] += 1 counter_x[x] += 1 end end H.times do |y| next if counter_y[y] == 2 W.times do |x| next if counter_x[x] == 2 next if S[y][x] == '*' S[y][x] = '*' puts S exit end end