#ifdef LOCAL #define _GLIBCXX_DEBUG #endif // LOCAL #pragma GCC optimize("O3") #include using namespace std; using ll = long long; void solve_test (istream &cin, ostream &cout) { string human, comp; cin >> human >> comp; vector cols = {"RED", "ORANGE", "YELLOW", "GREEN", "BLUE", "VIOLET"}; const string one_hole = "ADOPQR"; vector> holes(cols.size()); for (int i = 0; i < int(cols.size()); i++) { holes[i].resize(cols[i].size()); for (int j = 0; j < int(cols[i].size()); j++) { if (cols[i][j] == 'B') holes[i][j] = 2; else if (find(one_hole.begin(), one_hole.end(), cols[i][j]) != one_hole.end()) holes[i][j] = 1; else holes[i][j] = 0; } } vector ans(5); const int human_int = (find(cols.begin(), cols.end(), human) - cols.begin()); assert(human_int != int(cols.size())); // for (auto it : holes[human_int]) // cerr << it << ' '; // cerr << endl; for (int i = 0; i < int(human.size()); i++) { ans[0] += comp; for (int j = 1; j <= 3; j++) { ans[j] += "R"; if (j != 2) { ans[j] += string(int(comp.size()) - 2, '.'); ans[j] += "R"; } else { if (holes[human_int][i] == 0) ans[j] += string(int(comp.size()) - 1, '.'); else if (holes[human_int][i] == 1) { ans[j] += string(int(comp.size()) - 2, '.'); ans[j] += "R"; } else if (holes[human_int][i] == 2) { ans[j] += string(int(comp.size()) - 1, 'R'); } } } ans[4] += comp; if (i + 1 != int(human.size())) { for (auto &s : ans) s += "."; } } for (const auto &it : ans) cout << it << endl; } void solve (istream &cin, ostream &cout) { solve_test(cin, cout); } int main() { #ifdef LOCAL ifstream in("input.txt"); ofstream out("output.txt"); solve(in, out); #else solve_test(cin, cout); #endif }