using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; var (h, w) = (c[0], c[1]); var s = new char[h][]; var first = (-1, -1); var second = (-1, -1); for (var i = 0; i < h; ++i) { s[i] = ReadLine().ToCharArray(); for (var j = 0; j < w; ++j) if (s[i][j] == '*') { if (first.Item1 == -1) first = (i, j); else second = (i, j); } } if (first.Item1 == second.Item1) s[(first.Item1 + 1) % h][first.Item2] = '*'; else if (first.Item2 == second.Item2) s[first.Item1][(first.Item2 + 1) % w] = '*'; else s[first.Item1][second.Item2] = '*'; WriteLine(string.Join("\n", s.Select(si => string.Concat(si)))); } }