#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n)    FOR(i, 0, n)
#define pb           push_back
#define all(a)       (a).begin(), (a).end()

string cube[6] = {
    "..rr....", "..rr....", "ggyybbww", "ggyybbww", "..oo....", "..oo....",
};

void rotU() {
  char tmp = cube[2][0];
  cube[2][0] = cube[2][2];
  cube[2][2] = cube[2][4];
  cube[2][4] = cube[2][6];
  cube[2][6] = tmp;

  tmp = cube[2][3];
  cube[2][3] = cube[2][5];
  cube[2][5] = cube[2][7];
  cube[2][7] = cube[2][1];
  cube[2][1] = tmp;

  tmp = cube[1][3];
  cube[1][3] = cube[0][3];
  cube[0][3] = cube[0][2];
  cube[0][2] = cube[1][2];
  cube[1][2] = tmp;
}

void rotB() {
  char tmp = cube[2][6];
  cube[2][6] = cube[3][6];
  cube[3][6] = cube[3][7];
  cube[3][7] = cube[2][7];
  cube[2][7] = tmp;

  tmp = cube[2][0];
  cube[2][0] = cube[0][3];
  cube[0][3] = cube[3][5];
  cube[3][5] = cube[5][2];
  cube[5][2] = tmp;

  tmp = cube[3][0];
  cube[3][0] = cube[0][2];
  cube[0][2] = cube[2][5];
  cube[2][5] = cube[5][3];
  cube[5][3] = tmp;
}

void rotF() {
  char tmp = cube[2][2];
  cube[2][2] = cube[3][2];
  cube[3][2] = cube[3][3];
  cube[3][3] = cube[2][3];
  cube[2][3] = tmp;

  tmp = cube[1][2];
  cube[1][2] = cube[3][1];
  cube[3][1] = cube[4][3];
  cube[4][3] = cube[2][4];
  cube[2][4] = tmp;

  tmp = cube[1][3];
  cube[1][3] = cube[2][1];
  cube[2][1] = cube[4][2];
  cube[4][2] = cube[3][4];
  cube[3][4] = tmp;
}

void rotR() {
  char tmp = cube[2][4];
  cube[2][4] = cube[3][4];
  cube[3][4] = cube[3][5];
  cube[3][5] = cube[2][5];
  cube[2][5] = tmp;

  tmp = cube[0][3];
  cube[0][3] = cube[2][3];
  cube[2][3] = cube[4][3];
  cube[4][3] = cube[3][6];
  cube[3][6] = tmp;

  tmp = cube[1][3];
  cube[1][3] = cube[3][3];
  cube[3][3] = cube[5][3];
  cube[5][3] = cube[2][6];
  cube[2][6] = tmp;
}

void rotD() {
  char tmp = cube[3][0];
  cube[3][0] = cube[3][6];
  cube[3][6] = cube[3][4];
  cube[3][4] = cube[3][2];
  cube[3][2] = tmp;

  tmp = cube[3][1];
  cube[3][1] = cube[3][7];
  cube[3][7] = cube[3][5];
  cube[3][5] = cube[3][3];
  cube[3][3] = tmp;

  tmp = cube[4][2];
  cube[4][2] = cube[5][2];
  cube[5][2] = cube[5][3];
  cube[5][3] = cube[4][3];
  cube[4][3] = tmp;
}

void rotL() {
  char tmp = cube[2][0];
  cube[2][0] = cube[3][0];
  cube[3][0] = cube[3][1];
  cube[3][1] = cube[2][1];
  cube[2][1] = tmp;

  tmp = cube[1][2];
  cube[1][2] = cube[2][7];
  cube[2][7] = cube[5][2];
  cube[5][2] = cube[3][2];
  cube[3][2] = tmp;

  tmp = cube[0][2];
  cube[0][2] = cube[3][7];
  cube[3][7] = cube[4][2];
  cube[4][2] = cube[2][2];
  cube[2][2] = tmp;
}

void rot(char c) {
  switch (c) {
    case 'U':
      return rotU();
    case 'B':
      return rotB();
    case 'F':
      return rotF();
    case 'R':
      return rotR();
    case 'D':
      return rotD();
    case 'L':
      return rotL();
    default:
      cout << "error occured: unexpected input" << endl;
      break;
  }
}

void printResult() {
  rep(i, 6) cout << cube[i] << endl;
}

int main() {
  string s;
  cin >> s;

  rep(i, s.size()) {
    if (s[i] == 'U') {
      rot('U');
    } else if (s[i] == 'F') {
      rot('F');
    } else if (s[i] == 'R') {
      rot('R');
    } else if (s[i] == 'D') {
      rot('D');
    } else if (s[i] == 'B') {
      rot('B');
    } else if (s[i] == 'L') {
      rot('L');
    }
  }

  printResult();
}



Measured memory_bytes: 3208