h,w = gets.split.map(&:to_i) starflg = true while cin=gets if starflg && cin=~/(-*)\*/ x = $1.size if x == w-1 cin[x-1] = '*' else cin[x+1] = '*' end starflg = false end puts cin end