#include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <sstream>
#include <string>
#include <cstring>
#include <cstdlib>
#include <climits>
#include <cmath>
#include <map>

using namespace std;
typedef long long ll;


typedef pair<int,int> pii;
map<char,vector<pair<pii,pii> > > m;

int main(){

  vector<string > field;
  for(int i=0;i<6;i++)
    field.push_back("........");
  for(int i=0;i<=1;i++)
    for(int j=2;j<=3;j++)
      field[i][j]='r';
  for(int i=2;i<=3;i++){
    for(int j=0;j<=1;j++)
      field[i][j]='g';
    for(int j=2;j<=3;j++)
      field[i][j]='y';
    for(int j=4;j<=5;j++)
      field[i][j]='b';
    for(int j=6;j<=7;j++)
      field[i][j]='w';
  }
  for(int i=4;i<=5;i++)
    for(int j=2;j<=3;j++)
      field[i][j]='o';
  map<char,vector<pii> > faces;
  {
    {
      vector<pair<pii,pii> > v;
      v.push_back(make_pair(pii(0,3),pii(3,6)));
      v.push_back(make_pair(pii(1,3),pii(2,6)));
      v.push_back(make_pair(pii(3,6),pii(4,3)));
      v.push_back(make_pair(pii(2,6),pii(5,3)));
      v.push_back(make_pair(pii(4,3),pii(2,3)));
      v.push_back(make_pair(pii(5,3),pii(3,3)));
      v.push_back(make_pair(pii(3,3),pii(1,3)));
      v.push_back(make_pair(pii(2,3),pii(0,3)));
      faces['R'].push_back(pii(2,4));
      faces['R'].push_back(pii(2,5));
      faces['R'].push_back(pii(3,5));
      faces['R'].push_back(pii(3,4));
      m['R']=v;
    }
    {
      vector<pair<pii,pii> > v;
      v.push_back(make_pair(pii(0,2),pii(2,2)));
      v.push_back(make_pair(pii(1,2),pii(3,2)));
      v.push_back(make_pair(pii(2,2),pii(4,2)));
      v.push_back(make_pair(pii(3,2),pii(5,2)));
      v.push_back(make_pair(pii(4,2),pii(3,7)));
      v.push_back(make_pair(pii(5,2),pii(2,7)));
      v.push_back(make_pair(pii(2,7),pii(1,2)));
      v.push_back(make_pair(pii(3,7),pii(0,2)));
      m['L']=v;
      faces['L'].push_back(pii(2,0));
      faces['L'].push_back(pii(2,1));
      faces['L'].push_back(pii(3,1));
      faces['L'].push_back(pii(3,0));
    }
  }
  {
    {
      vector<pair<pii,pii> > v;
      v.push_back(make_pair(pii(2,7),pii(2,5)));
      v.push_back(make_pair(pii(2,6),pii(2,4)));
      v.push_back(make_pair(pii(2,5),pii(2,3)));
      v.push_back(make_pair(pii(2,4),pii(2,2)));
      v.push_back(make_pair(pii(2,3),pii(2,1)));
      v.push_back(make_pair(pii(2,2),pii(2,0)));
      v.push_back(make_pair(pii(2,1),pii(2,7)));
      v.push_back(make_pair(pii(2,0),pii(2,6)));
      m['U']=v;
      faces['U'].push_back(pii(0,2));
      faces['U'].push_back(pii(0,3));
      faces['U'].push_back(pii(1,3));
      faces['U'].push_back(pii(1,2));
    }
    {
      vector<pair<pii,pii> > v;
      v.push_back(make_pair(pii(3,0),pii(3,2)));
      v.push_back(make_pair(pii(3,1),pii(3,3)));
      v.push_back(make_pair(pii(3,2),pii(3,4)));
      v.push_back(make_pair(pii(3,3),pii(3,5)));
      v.push_back(make_pair(pii(3,4),pii(3,6)));
      v.push_back(make_pair(pii(3,5),pii(3,7)));
      v.push_back(make_pair(pii(3,6),pii(3,0)));
      v.push_back(make_pair(pii(3,7),pii(3,1)));
      m['D']=v;
      faces['D'].push_back(pii(4,2));
      faces['D'].push_back(pii(4,3));
      faces['D'].push_back(pii(5,3));
      faces['D'].push_back(pii(5,2));
    }
  }
  {
    {
      vector<pair<pii,pii> > v;
      v.push_back(make_pair(pii(1,2),pii(2,4)));
      v.push_back(make_pair(pii(1,3),pii(3,4)));
      v.push_back(make_pair(pii(2,4),pii(4,3)));
      v.push_back(make_pair(pii(3,4),pii(4,2)));
      v.push_back(make_pair(pii(4,3),pii(3,1)));
      v.push_back(make_pair(pii(4,2),pii(2,1)));
      v.push_back(make_pair(pii(3,1),pii(1,2)));
      v.push_back(make_pair(pii(2,1),pii(1,3)));
      m['F']=v;
      faces['F'].push_back(pii(2,2));
      faces['F'].push_back(pii(2,3));
      faces['F'].push_back(pii(3,3));
      faces['F'].push_back(pii(3,2));
    }
    {
      vector<pair<pii,pii> > v;
      v.push_back(make_pair(pii(0,2),pii(3,0)));
      v.push_back(make_pair(pii(0,3),pii(2,0)));

      v.push_back(make_pair(pii(3,0),pii(5,3)));
      v.push_back(make_pair(pii(2,0),pii(5,2)));

      v.push_back(make_pair(pii(5,3),pii(2,5)));
      v.push_back(make_pair(pii(5,2),pii(3,5)));
      
      v.push_back(make_pair(pii(2,5),pii(0,2)));
      v.push_back(make_pair(pii(3,5),pii(0,3)));

      m['B']=v;
      faces['B'].push_back(pii(2,6));
      faces['B'].push_back(pii(2,7));
      faces['B'].push_back(pii(3,7));
      faces['B'].push_back(pii(3,6));
    }
    // for(int i=0;i<(int)v.size();i++)
    //   swap(v[i].first,v[i].second);
    // m['B']=v;
  }

  string s;
  cin>>s;
  for(int i=0;i<(int)s.size();i++){
    vector<pair<pii,pii> > v=m[s[i]];
    vector<string> nfield=field;
    for(int j=0;j<(int)v.size();j++){
      pii from=v[j].first;
      pii to=v[j].second;
      char ch=field[from.first][from.second];
      nfield[to.first][to.second]=ch;
    }
    vector<pii> v2=faces[s[i]];
    for(int j=0;j<(int)v2.size();j++){
      pii from=v2[j];
      pii to=v2[(j+1)%(int)v2.size()];
      char ch=field[from.first][from.second];
      nfield[to.first][to.second]=ch;
    }
    field=nfield;
  }
  for(int i=0;i<(int)field.size();i++)
    cout<<field[i]<<endl;
  
  return 0;
}

Measured memory_bytes: 1200