#include typedef struct {int h; int w;} vect; int i, j, h, w; char s[100][101]; vect x, y; void findstars() { x.h = -1; for (i = 0; i < h; i++) for (j = 0; j < w; j++) { if (s[i][j] == '*') { if (x.h == -1) { x.h = i; x.w = j; } else { y.h = i; y.w = j; return; } } } } void l () { for (i = 0; i < h; i++) puts(s[i]); return; } int main(int argc, char const *argv[]) { scanf("%d%d", &h, &w); for (i = 0; i < h; i++) scanf("%s", s[i]); findstars(); if (x.h == y.h) { s[(x.h + 1) % h][y.w] = '*'; } else if (x.w == y.w) { s[x.h][(y.w + 1) % w] = '*'; } else{ s[x.h][y.w] = '*'; } l(); return 0; }