#include using namespace std; using ll = long long; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); ll h, w; cin >> h >> w; vector s(h); for(auto&& x : s) cin >> x; for (int i=0; i 0 && s[i][j-1] == 'y') s[i][j-1] = 'Y'; if (j < w-1 && s[i][j+1] == 'y') s[i][j+1] = 'Y'; } } for(auto&& x : s) cout << x << '\n'; }