#include //入力系 #define cinll(...) ll __VA_ARGS__; input(__VA_ARGS__); #define cinint(...) int __VA_ARGS__; input(__VA_ARGS__); #define cinstr(...) string __VA_ARGS__; input(__VA_ARGS__); #define cinchar(...) char __VA_ARGS__; input(__VA_ARGS__); #define cindouble(...) double __VA_ARGS__; input(__VA_ARGS__); #define cinvll(a,n) vll a(n); rep(i,n) cin>>a[i]; #define cinvvll(a,n,m) vvll a(n,vll(m)); rep(i,n) rep(j,m) cin>>a[i][j]; #define cinvs(a,n) vs a(n); rep(i,n) cin>>a[i]; #define cinvpll(a,n) vpll a(n); rep(i,n) cin>>a[i].fst>>a[i].snd; //繰り返し系 #define rep1(n) for(ll i=0;i=0;i--) #define mrep2(i,n) for(ll i=n;i>=0;i--) #define mrep3(i,n,a) for(ll i=n;i>=a;i--) #define mrep4(i,n,a,b) for(ll i=n;i>=a;i-=b) #define mrep(...) overload4(__VA_ARGS__,mrep4,mrep3,mrep2,mrep1)(__VA_ARGS__) //iterator系 #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() //書くのが長いやつ #define fst first #define snd second #define cvvll1(name,a,b) vvll name(a, vll(b)) #define cvvll2(name,a,b,c) vvll name(a, vll(b,c)) #define cvvlloverload2(name,a,b,c,d,...) d #define make_vvll(...) cvvlloverload2(__VA_ARGS__,cvvll2,cvvll1)(__VA_ARGS__) using namespace std; //型系 using ll = long long; using vll = vector; using vvll = vector>; using vi = vector; using vvi = vector>; using vb = vector; using vvb = vector>; using vd = vector; using vvd = vector>; using vc = vector; using vvc = vector>; using vs = vector; using pll = pair; using pi = pair; using pd = pair; using sll = set; using vsll = vector>; using vpll = vector>; using vpi = vector; using vpd = vector>; using vvpll = vector>>; #define vmll vector #define vvmll vector> const ll mod = 998244353LL; //const ll mod = 1000000007LL; const ll inf = 1300100100100100100LL; const double PI=3.1415926535897932384626433832795028841971; //表示 #define overload1(a,b,NAME,...) NAME #define coutYesReturn() do {coutYes(); return 0; } while(0) #define coutYesReturnIf(a) do { if(a){ coutYesReturn(); }} while(0) #define coutNoReturn() do {coutNo(); return 0;} while(0) #define coutNoReturnIf(a) do {if(a){ coutNoReturn(); }} while(0) #define coutReturnIf(a,s) do{if(a){cout< void coutll(T... a){ ((cout << a <<" "),...) << endl; } void coutvll(vll &a){ rep(i,a.size()) cout< void input(T&... a){ (cin >> ... >> a); } //複数ソート template void sorts(vector&... a){ (sort(all(a)),...); } //便利関数 template bool chmax(T &a, T b){ if(a < b) {a = b; return true;} return false; } template bool chmin(T &a, T b){ if(a > b) {a = b; return true;} return false; } //配列表示用 template std::ostream& operator<<(std::ostream& os, const std::vector& vec) { rep(i,vec.size()) os << vec[i] << (i==(ll)vec.size()-1?"":" "); return os; } //縦0以上h未満、横0以上w未満の(i,j)の4近傍をとる vpll kinbo4(ll h,ll w, ll i,ll j){ vpll ret; if(i-1 >= 0) ret.push_back({i-1,j}); if(j-1 >= 0) ret.push_back({i,j-1}); if(i+1 < h) ret.push_back({i+1,j}); if(j+1 < w) ret.push_back({i,j+1}); return ret; } string f(ll n, string s){ string ret; rep(i, s.size()) if(n&(1LL << i)) ret += string(1, s[i]); return ret; } int main(){ cinll(h, w); cinvs(s, h); vvc cs(h, vc(w)); rep(i,h) rep(j,w) cs[i][j] = s[i][j]; rep(i,h) rep(j,w) if(cs[i][j] == '9'){ if(j-1 >= 0 && cs[i][j-1] == 'y') cs[i][j-1] = 'Y'; if(j+1 < w && cs[i][j+1] == 'y') cs[i][j+1] = 'Y'; } rep(i,h){ rep(j,w) cout << cs[i][j]; cout << endl; } return 0; }