#include using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() template inline bool chmax(A &a, B b) { if (a inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; } typedef unsigned long long ull; typedef long long ll; typedef pair pii; typedef pair pll; const ll INF = 1ll<<29; const ll MOD = 1000000007; const double EPS = 1e-10; int h, w; string s[100]; int main() { cin >> h >> w; REP(i, h) cin >> s[i]; pii p[2]; int cnt = 0; REP(i, h) REP(j, w) if (s[i][j] == '*') { p[cnt++] = pii(i, j); } pii ans; if (p[0].first == p[1].first) { if (p[0].first == 0) ans = pii(p[0].first + 1, 0); else ans = pii(p[0].first - 1, 0); } else if (p[0].second == p[1].second) { if (p[0].second == 0) ans = pii(0, p[0].second + 1); else ans = pii(0, p[0].second - 1); } else { if (p[0].first == 0) ans = pii(1, p[0].second); else ans = pii(p[0].first - 1, p[0].second); } s[ans.first][ans.second] = '*'; REP(i, h) cout << s[i] << endl; return 0; }