// ConsoleApplication8.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//
// ConsoleApplication4.cpp : Defines the entry point for the console application.
//

#include <string>;
#include <iostream>;
using namespace std;

const int maxH = 100;
const int maxW = 100;
string table[maxH];
int main()
{
	int H, W;
	cin >> H >> W;
	for (int i = 0; i < H; ++i) {
		cin >> table[i];
	}

	int x[2];
	int y[2];
	int c = 0;
	for (int i = 0; i < H; ++i) {
		for (int j = 0; j < W; ++j) {
			if (table[i][j] == '*') {
				y[c] = i;
				x[c] = j;
				++c;
			}
		}
	}
	if (x[0] > x[1]) {
		swap(x[0], x[1]);
		swap(y[0], y[1]);
	}
	int px = -1, py = -1;
	for (int i = 0; i < H; ++i) {
		for (int j = 0; j < W; ++j) {
			if (table[i][j] == '*')continue;
			if (x[0] == x[1] && x[1] == j)continue;
			if (y[0] == y[1] && y[1] == i)continue;
			if ((x[0] - x[1])*(y[0] - i) != (y[0] - y[1])*(x[0] - j) && (x[1] - x[0])*(y[1] - i) != (y[1] - y[0])*(x[1] - j) ) {
				px = j;
				py = i;
				goto out;
			}
		}
	}
out:
	cout << endl;

	for (int i = 0; i < H; ++i) {
		for (int j = 0; j < W; ++j) {
			if (i == py&&j == px)
				cout << '*';
			else
				cout << table[i][j];
		}
		cout << endl;
	}
	return 0;
}