import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * * @author Chiaki.Hoshinomori */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); Task455 solver = new Task455(); solver.solve(1, in, out); out.close(); } static class Task455 { public void solve(int testNumber, InputReader in, PrintWriter out) { int n = in.nextInt(); int m = in.nextInt(); char[][] s = new char[n][]; int x1 = -1, y1 = -1; int x2 = -1, y2 = -1; for (int i = 0; i < n; i++) { s[i] = in.next().toCharArray(); for (int j = 0; j < m; j++) { if (s[i][j] == '*') { if (x1 == -1) { x1 = i; y1 = j; } else { x2 = i; y2 = j; } } } } for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { if (s[i][j] == '*') continue; if ((x2 - x1) * (j - y1) - (i - x1) * (y2 - y1) != 0) { s[i][j] = '*'; for (int k = 0; k < n; k++) { out.println(s[k]); } return; } } } } } static class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream), 32768); tokenizer = null; } public String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { tokenizer = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return tokenizer.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } } }