/* -*- coding: utf-8 -*- * * 455.cc: No.455 冬の大三角 - yukicoder */ #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<iostream> #include<string> #include<vector> #include<map> #include<set> #include<stack> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<functional> using namespace std; /* constant */ const int MAX_H = 100; const int MAX_W = 100; /* typedef */ template <typename T> struct Pt { T x, y; Pt() {} Pt(T _x, T _y) : x(_x), y(_y) {} Pt(const Pt& pt) : x(pt.x), y(pt.y) {} bool operator==(const Pt pt) const { return x == pt.x && y == pt.y; } Pt<T> operator+(const Pt pt) const { return Pt<T>(x + pt.x, y + pt.y); } Pt<T> operator-() const { return Pt<T>(-x, -y); } Pt<T> operator-(const Pt pt) const { return Pt<T>(x - pt.x, y - pt.y); } T dot(Pt v) const { return x * v.x + y * v.y; } T cross(Pt v) const { return x * v.y - y * v.x; } }; typedef Pt<int> pt; /* global variables */ string bds[MAX_H]; pt ps[3]; /* subroutines */ /* main */ int main() { int h, w; cin >> h >> w; for (int y = 0, k = 0; y < h; y++) { cin >> bds[y]; for (int x = 0; x < w; x++) if (bds[y][x] == '*') ps[k++] = pt(x, y); } bool ok = false; for (int y = 0; ! ok && y < h; y++) for (int x = 0; ! ok && x < w; x++) { pt p(x, y), v0(p - ps[0]), v1(p - ps[1]); if (v0.cross(v1) != 0) { bds[y][x] = '*'; ok = true; } } for (int y = 0; y < h; y++) cout << bds[y] << endl; return 0; }