#include<iostream>
#include<string>
#include<utility>
#include<vector>

using namespace std;
vector<pair<int, int> > stars;
vector<string> board;
int H, W;

bool check(int x, int y) {
    int dx0 = x-stars[0].first, dy0 = y-stars[0].second;
    int dx1 = x-stars[1].first, dy1 = y-stars[1].second;
    if (dx0 == 0 && dy0 == 0) return false;
    if (dx1 == 0 && dy1 == 0) return false;
    if (dx0*dy1 == dx1*dy0) return false;
    return true;
}

int main() {
    cin >> H >> W;
    board.resize(H);
    for (int i = 0; i < H; i++) {
        cin >> board[i];
        for (int j = 0; j < W; j++) {
            if (board[i][j] == '*') stars.emplace_back(j, i);
        }
    }
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            if (check(j, i)) {
                board[i][j] = '*';
                for (int y = 0; y < H; y++) {
                    cout << board[y] << endl;
                }
                return 0;
            }
        }
    }
    return 0;
}