#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;

enum FACE { UP, DOWN, FRONT, BACK, LEFT, RIGHT };

class cube {
public:
	char col[6][2][2];
	cube() {
		for(int i = 0; i < 2; ++i) {
			for(int j = 0; j < 2; ++j) {
				col[UP][i][j] = 'r';
				col[DOWN][i][j] = 'o';
				col[FRONT][i][j] = 'y';
				col[BACK][i][j] = 'w';
				col[LEFT][i][j] = 'g';
				col[RIGHT][i][j] = 'b';
			}
		}
	}

	void roll(FACE f) {
		char tmp = col[f][0][0];
		col[f][0][0] = col[f][1][0];
		col[f][1][0] = col[f][1][1];
		col[f][1][1] = col[f][0][1];
		col[f][0][1] = tmp;
	}

	void up() {
		char tmp[2] = {col[FRONT][0][0], col[FRONT][0][1]};
		for(int i = 0; i < 2; ++i) {
			col[FRONT][0][i] = col[RIGHT][0][i];
			col[RIGHT][0][i] = col[BACK][0][i];
			col[BACK][0][i] = col[LEFT][0][i];
			col[LEFT][0][i] = tmp[i];
		}
		roll(UP);
	}
	void down() {
		char tmp[2] = {col[FRONT][1][0], col[FRONT][1][1]};
		for(int i = 0; i < 2; ++i) {
			col[FRONT][1][i] = col[LEFT][1][i];
			col[LEFT][1][i] = col[BACK][1][i];
			col[BACK][1][i] = col[RIGHT][1][i];
			col[RIGHT][1][i] = tmp[i];
		}
		roll(DOWN);
	}

	void front() {
		char tmp[2] = {col[UP][1][0], col[UP][1][1]};
		for(int i = 0; i < 2; ++i) {
			col[UP][1][i] = col[LEFT][1 - i][1];
			col[LEFT][1 - i][1] = col[DOWN][0][1 - i];
			col[DOWN][0][1 - i] = col[RIGHT][i][0];
			col[RIGHT][i][0] = tmp[i];
		}
		roll(FRONT);
	}
	void back() {
		char tmp[2] = {col[UP][0][0], col[UP][0][1]};
		for(int i = 0; i < 2; ++i) {
			col[UP][0][i] = col[RIGHT][i][1];
			col[RIGHT][i][1] = col[DOWN][1][1 - i];
			col[DOWN][1][1 - i] = col[LEFT][1 - i][0];
			col[LEFT][1 - i][0] = tmp[i];
		}
		roll(BACK);
	}
	void right() {
		char tmp[2] = {col[FRONT][0][1], col[FRONT][1][1]};
		for(int i = 0; i < 2; ++i) {
			col[FRONT][i][1] = col[DOWN][i][1];
			col[DOWN][i][1] = col[BACK][1 - i][0];
			col[BACK][1 - i][0] = col[UP][i][1];
			col[UP][i][1] = tmp[i];
		}
		roll(RIGHT);
	}
	void left() {
		char tmp[2] = {col[FRONT][0][0], col[FRONT][1][0]};
		for(int i = 0; i < 2; ++i) {
			col[FRONT][i][0] = col[UP][i][0];
			col[UP][i][0] = col[BACK][1 - i][1];
			col[BACK][1 - i][1] = col[DOWN][i][0];
			col[DOWN][i][0] = tmp[i];
		}
		roll(LEFT);
	}

	void print() {
		for(int i = 0; i < 2; ++i) {
			cout << "..";
			for(int j = 0; j < 2; ++j)
				cout << col[UP][i][j];
			cout << "...." << endl;
		}

		for(int i = 0; i < 2; ++i) {
			for(int j = 0; j < 2; ++j)
				cout << col[LEFT][i][j];
			for(int j = 0; j < 2; ++j)
				cout << col[FRONT][i][j];
			for(int j = 0; j < 2; ++j)
				cout << col[RIGHT][i][j];
			for(int j = 0; j < 2; ++j)
				cout << col[BACK][i][j];

			cout << endl;
		}

		for(int i = 0; i < 2; ++i) {
			cout << "..";
			for(int j = 0; j < 2; ++j)
				cout << col[DOWN][i][j];
			cout << "...." << endl;
		}
	}
};

int main() {
	cin.tie(false);
	ios::sync_with_stdio(false);

	string s;
	cin >> s;

	cube c;
	for(int i = 0; i < s.size(); ++i) {
		if(s[i] == 'U')
			c.up();
			
		else if(s[i] == 'F')
			c.front();

		else if(s[i] == 'R')
			c.right();

		else if(s[i] == 'D')
			c.down();

		else if(s[i] == 'B')
			c.back();

		else
			c.left();
	}

	c.print();

	return EXIT_SUCCESS;
}

Measured memory_bytes: 1184