var obj = {};
obj.U = "rrrr".split("");
obj.D = "oooo".split("");
obj.F = "yyyy".split("");
obj.L = "gggg".split("");
obj.R = "bbbb".split("");
obj.B = "wwww".split("");
 
function topRotateFn(k) {
   var a = obj[k].slice();
   obj[k][0] = a[2];
   obj[k][1] = a[0];
   obj[k][2] = a[3];
   obj[k][3] = a[1];
}
 
function mawasu(str) {
   var arr = str.split(",");
   var a = [];
   arr.forEach(v => {
      var getArray = getFn(v);
      a.push(getArray[0], getArray[1]);
   });
   a = a.slice(-2).concat(a.slice(0, -2));
   arr.forEach((v, i) => {
      setFn(v, a[i * 2], a[i * 2 + 1]);
   });
}
 
function getFn(v) {
   var [k, n] = v.split("");
   if (n == "0") return [obj[k][0], obj[k][1]];
   else if (n == "1") return [obj[k][1], obj[k][3]];
   else if (n == "2") return [obj[k][2], obj[k][0]];
   else if (n == "3") return [obj[k][3], obj[k][2]];
}
 
function setFn(v, a, b) {
   var [k, n] = v.split("");
   if(n=="0"){obj[k][0]=a;obj[k][1]=b;}
   else if(n=="1"){obj[k][1]=a;obj[k][3]=b;}
   else if(n=="2"){obj[k][2]=a;obj[k][0]=b;}
   else if(n=="3"){obj[k][3]=a;obj[k][2]=b;}
}
 
function writeFn(y, x, s) {
   yx[y][x] = obj[s][0];
   yx[y][x + 1] = obj[s][1];
   yx[y + 1][x] = obj[s][2];
   yx[y + 1][x + 1] = obj[s][3];
}
 
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr = input.trim().split("");
arr.forEach(v => {
   topRotateFn(v);
   if (v == "U") mawasu("F0,L0,B0,R0")
   else if (v == "D") mawasu("F3,R3,B3,L3");
   else if (v == "F") mawasu("R2,D0,L1,U3");
   else if (v == "L") mawasu("F2,D2,B1,U2");
   else if (v == "R") mawasu("U1,B2,D1,F1");
   else if (v == "B") mawasu("R1,U0,L2,D3");
});
var yx = [];
for (var i = 0; i < 6; i++) yx[i] = "........".split("");
for (var s in obj) {
   if (s == "U") writeFn(0, 2, s);
   else if (s == "D") writeFn(4, 2, s);
   else if (s == "F") writeFn(2, 2, s);
   else if (s == "L") writeFn(2, 0, s);
   else if (s == "R") writeFn(2, 4, s);
   else if (s == "B") writeFn(2, 6, s);
}
console.log(yx.join("\n").replace(/\,/g, ""));
