/* -*- coding: utf-8 -*- * * 3261.cc: No.3261 yiwiy9 竊・yiwiY9 - yukicoder */ #include #include using namespace std; /* constant */ const int MAX_W = 200; /* typedef */ /* global variables */ char s[MAX_W + 4]; /* subroutines */ /* main */ int main() { int h, w; scanf("%d%d", &h, &w); for (int i = 0; i < h; i++) { scanf("%s", s); for (int j = 0; j < w;) { if (s[j] == 'y') { // right s[j + 4] = 'Y', j += 6; } else if (s[j] == '9') { // left s[j + 1] = 'Y', j += 6; } else j++; } puts(s); } return 0; }