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

struct Cube{
    
    public:
    
    char data[6][8] = {
        {'.','.','r','r','.','.','.','.'},
        {'.','.','r','r','.','.','.','.'},
        {'g','g','y','y','b','b','w','w'},
        {'g','g','y','y','b','b','w','w'},
        {'.','.','o','o','.','.','.','.'},
        {'.','.','o','o','.','.','.','.'}
    };
    
    void print(){
        for(int i = 0;i < 6;i++){
            for(int j = 0;j < 8;j++){
                cout << data[i][j] << (j == 7 ? "\n" : "");
            }
        }
    }
    
    void up(){
        char new_data[6][8];
        for(int i = 0;i < 6;i++){
            for(int j = 0;j < 8;j++){
                new_data[i][j] = data[i][j];
            }
        }
        //がんばる
        new_data[0][2] = data[1][2];
        new_data[0][3] = data[0][2];
        new_data[1][2] = data[1][3];
        new_data[1][3] = data[0][3];
        new_data[2][0] = data[2][2];
        new_data[2][1] = data[2][3];
        new_data[2][2] = data[2][4];
        new_data[2][3] = data[2][5];
        new_data[2][4] = data[2][6];
        new_data[2][5] = data[2][7];
        new_data[2][6] = data[2][0];
        new_data[2][7] = data[2][1];
        //がんばった
        for(int i = 0;i < 6;i++){
            for(int j = 0;j < 8;j++){
                data[i][j] = new_data[i][j];
            }
        }
    }
    
    void left(){
        char new_data[6][8];
        for(int i = 0;i < 6;i++){
            for(int j = 0;j < 8;j++){
                new_data[i][j] = data[i][j];
            }
        }
        //がんばる
        new_data[0+2][2-2] = data[1+2][2-2];
        new_data[0+2][3-2] = data[0+2][2-2];
        new_data[1+2][2-2] = data[1+2][3-2];
        new_data[1+2][3-2] = data[0+2][3-2];
        new_data[0][2] = data[3][7];
        new_data[1][2] = data[2][7];
        new_data[2][2] = data[0][2];
        new_data[3][2] = data[1][2];
        new_data[4][2] = data[2][2];
        new_data[5][2] = data[3][2];
        new_data[3][7] = data[4][2];
        new_data[2][7] = data[5][2];
        //がんばった
        for(int i = 0;i < 6;i++){
            for(int j = 0;j < 8;j++){
                data[i][j] = new_data[i][j];
            }
        }
    }
    
    void front(){
        char new_data[6][8];
        for(int i = 0;i < 6;i++){
            for(int j = 0;j < 8;j++){
                new_data[i][j] = data[i][j];
            }
        }
        //がんばる
        new_data[0+2][2] = data[1+2][2];
        new_data[0+2][3] = data[0+2][2];
        new_data[1+2][2] = data[1+2][3];
        new_data[1+2][3] = data[0+2][3];
        new_data[1][2] = data[3][1];
        new_data[1][3] = data[2][1];
        new_data[2][4] = data[1][2];
        new_data[3][4] = data[1][3];
        new_data[4][3] = data[2][4];
        new_data[4][2] = data[3][4];
        new_data[3][1] = data[4][3];
        new_data[2][1] = data[4][2];
        //がんばった
        for(int i = 0;i < 6;i++){
            for(int j = 0;j < 8;j++){
                data[i][j] = new_data[i][j];
            }
        }
    }
    
    void right(){
        char new_data[6][8];
        for(int i = 0;i < 6;i++){
            for(int j = 0;j < 8;j++){
                new_data[i][j] = data[i][j];
            }
        }
        //がんばる
        new_data[0+2][2+2] = data[1+2][2+2];
        new_data[0+2][3+2] = data[0+2][2+2];
        new_data[1+2][2+2] = data[1+2][3+2];
        new_data[1+2][3+2] = data[0+2][3+2];
        new_data[5][3] = data[2][6];
        new_data[4][3] = data[3][6];
        new_data[3][3] = data[5][3];
        new_data[2][3] = data[4][3];
        new_data[1][3] = data[3][3];
        new_data[0][3] = data[2][3];
        new_data[2][6] = data[1][3];
        new_data[3][6] = data[0][3];
        //がんばった
        for(int i = 0;i < 6;i++){
            for(int j = 0;j < 8;j++){
                data[i][j] = new_data[i][j];
            }
        }
    }
    
    void back(){
        char new_data[6][8];
        for(int i = 0;i < 6;i++){
            for(int j = 0;j < 8;j++){
                new_data[i][j] = data[i][j];
            }
        }
        //がんばる
        new_data[0+2][2+4] = data[1+2][2+4];
        new_data[0+2][3+4] = data[0+2][2+4];
        new_data[1+2][2+4] = data[1+2][3+4];
        new_data[1+2][3+4] = data[0+2][3+4];
        new_data[3][5] = data[5][2];
        new_data[2][5] = data[5][3];
        new_data[0][3] = data[3][5];
        new_data[0][2] = data[2][5];
        new_data[2][0] = data[0][3];
        new_data[3][0] = data[0][2];
        new_data[5][2] = data[2][0];
        new_data[5][3] = data[3][0];
        //がんばった
        for(int i = 0;i < 6;i++){
            for(int j = 0;j < 8;j++){
                data[i][j] = new_data[i][j];
            }
        }
    }
    
    void down(){
        char new_data[6][8];
        for(int i = 0;i < 6;i++){
            for(int j = 0;j < 8;j++){
                new_data[i][j] = data[i][j];
            }
        }
        //がんばる
        new_data[0+4][2] = data[1+4][2];
        new_data[0+4][3] = data[0+4][2];
        new_data[1+4][2] = data[1+4][3];
        new_data[1+4][3] = data[0+4][3];
        new_data[3][0] = data[3][6];
        new_data[3][1] = data[3][7];
        new_data[3][2] = data[3][0];
        new_data[3][3] = data[3][1];
        new_data[3][4] = data[3][2];
        new_data[3][5] = data[3][3];
        new_data[3][6] = data[3][4];
        new_data[3][7] = data[3][5];
        //がんばった
        for(int i = 0;i < 6;i++){
            for(int j = 0;j < 8;j++){
                data[i][j] = new_data[i][j];
            }
        }
    }
    
}cube;

int main(){
    string S;
    cin >> S;
    for(int i = 0;i < S.size();i++){
        switch(S[i]){
            case 'U':
                cube.up();
                break;
            case 'F':
                cube.front();
                break;
            case 'R':
                cube.right();
                break;
            case 'D':
                cube.down();
                break;
            case 'B':
                cube.back();
                break;
            case 'L':
                cube.left();
                break;
            default:
                return 1;
        }
    }
    cube.print();
}


Measured memory_bytes: 3220