#include <iostream>
#include <vector>
using namespace std;

vector<string> t;

void rotateU(){
  vector<string> t2 = t;

  t[2][0] = t2[2][2];
  t[2][1] = t2[2][3];
  t[2][2] = t2[2][4];
  t[2][3] = t2[2][5];
  t[2][4] = t2[2][6];
  t[2][5] = t2[2][7];
  t[2][6] = t2[2][0];
  t[2][7] = t2[2][1];

  int ADDX = 2;
  int ADDY = 0;
  t[ADDY + 0][ADDX + 0] = t2[ADDY + 1][ADDX + 0];
  t[ADDY + 1][ADDX + 0] = t2[ADDY + 1][ADDX + 1];
  t[ADDY + 1][ADDX + 1] = t2[ADDY + 0][ADDX + 1];
  t[ADDY + 0][ADDX + 1] = t2[ADDY + 0][ADDX + 0];
}

void rotateF(){
  vector<string> t2 = t;

  t[1][3] = t2[2][1];
  t[1][2] = t2[3][1];
  t[2][1] = t2[4][2];
  t[3][1] = t2[4][3];
  t[4][2] = t2[3][4];
  t[4][3] = t2[2][4];
  t[3][4] = t2[1][3];
  t[2][4] = t2[1][2];

  int ADDX = 2;
  int ADDY = 2;
  t[ADDY + 0][ADDX + 0] = t2[ADDY + 1][ADDX + 0];
  t[ADDY + 1][ADDX + 0] = t2[ADDY + 1][ADDX + 1];
  t[ADDY + 1][ADDX + 1] = t2[ADDY + 0][ADDX + 1];
  t[ADDY + 0][ADDX + 1] = t2[ADDY + 0][ADDX + 0];
}

void rotateR(){
  vector<string> t2 = t;

  t[0][3] = t2[2][3];
  t[1][3] = t2[3][3];
  t[2][3] = t2[4][3];
  t[3][3] = t2[5][3];
  t[4][3] = t2[3][6];
  t[5][3] = t2[2][6];
  t[3][6] = t2[0][3];
  t[2][6] = t2[1][3];

  int ADDX = 4;
  int ADDY = 2;
  t[ADDY + 0][ADDX + 0] = t2[ADDY + 1][ADDX + 0];
  t[ADDY + 1][ADDX + 0] = t2[ADDY + 1][ADDX + 1];
  t[ADDY + 1][ADDX + 1] = t2[ADDY + 0][ADDX + 1];
  t[ADDY + 0][ADDX + 1] = t2[ADDY + 0][ADDX + 0];
}

void rotateD(){
  vector<string> t2 = t;

  t[3][0] = t2[3][6];
  t[3][1] = t2[3][7];
  t[3][2] = t2[3][0];
  t[3][3] = t2[3][1];
  t[3][4] = t2[3][2];
  t[3][5] = t2[3][3];
  t[3][6] = t2[3][4];
  t[3][7] = t2[3][5];

  int ADDX = 2;
  int ADDY = 4;
  t[ADDY + 0][ADDX + 0] = t2[ADDY + 1][ADDX + 0];
  t[ADDY + 1][ADDX + 0] = t2[ADDY + 1][ADDX + 1];
  t[ADDY + 1][ADDX + 1] = t2[ADDY + 0][ADDX + 1];
  t[ADDY + 0][ADDX + 1] = t2[ADDY + 0][ADDX + 0];
}

void rotateB(){
  vector<string> t2 = t;

  t[0][3] = t2[3][5];
  t[0][2] = t2[2][5];
  t[2][0] = t2[0][3];
  t[3][0] = t2[0][2];
  t[5][2] = t2[2][0];
  t[5][3] = t2[3][0];
  t[3][5] = t2[5][2];
  t[2][5] = t2[5][3];

  int ADDX = 6;
  int ADDY = 2;
  t[ADDY + 0][ADDX + 0] = t2[ADDY + 1][ADDX + 0];
  t[ADDY + 1][ADDX + 0] = t2[ADDY + 1][ADDX + 1];
  t[ADDY + 1][ADDX + 1] = t2[ADDY + 0][ADDX + 1];
  t[ADDY + 0][ADDX + 1] = t2[ADDY + 0][ADDX + 0];
}

void rotateL(){
  vector<string> t2 = t;

  t[0][2] = t2[3][7];
  t[1][2] = t2[2][7];
  t[2][2] = t2[0][2];
  t[3][2] = t2[1][2];
  t[4][2] = t2[2][2];
  t[5][2] = t2[3][2];
  t[3][7] = t2[4][2];
  t[2][7] = t2[5][2];

  int ADDX = 0;
  int ADDY = 2;
  t[ADDY + 0][ADDX + 0] = t2[ADDY + 1][ADDX + 0];
  t[ADDY + 1][ADDX + 0] = t2[ADDY + 1][ADDX + 1];
  t[ADDY + 1][ADDX + 1] = t2[ADDY + 0][ADDX + 1];
  t[ADDY + 0][ADDX + 1] = t2[ADDY + 0][ADDX + 0];
}

int main(){
  string s;

  while(cin >> s){
    t.clear();
    t.push_back("..rr....");
    t.push_back("..rr....");
    t.push_back("ggyybbww");
    t.push_back("ggyybbww");
    t.push_back("..oo....");
    t.push_back("..oo....");

    for(int i = 0; i < s.size(); i++){
      if(s[i] == 'U') rotateU();
      if(s[i] == 'F') rotateF();
      if(s[i] == 'R') rotateR();
      if(s[i] == 'D') rotateD();
      if(s[i] == 'B') rotateB();
      if(s[i] == 'L') rotateL();
    }

    for(int i = 0; i < t.size(); i++){
      cout << t[i] << endl;
    }
  }
}

Measured memory_bytes: 1196