#include using namespace std; #define rep(i, n) for(int i = 0; i < n; i++) int main() { int H, W; string S[100]; vector< pair< int, int > > pt; cin >> H >> W; rep(i, H) { cin >> S[i]; rep(j, W) if(S[i][j] == '*') pt.emplace_back(i, j); } if(pt[0].first == pt[1].first) { if(pt[0].first == 0) S[pt[0].first + 1][pt[0].second] = '*'; else S[pt[0].first - 1][pt[0].second] = '*'; } else if(pt[0].second == pt[1].second) { if(pt[0].second == 0) S[pt[0].first][pt[0].second + 1] = '*'; else S[pt[0].first][pt[0].second - 1] = '*'; } else { S[pt[0].first][pt[1].second] = '*'; } rep(i, H) cout << S[i] << endl; }