{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eErno\u0027s small brother have lost his Rubik\u0027s cube. The next day he brought a saw.\r\nHis goal was Erno\u0027s rectangular parallelepiped, all six faces of which were painted in different colors…\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eWhen Erno saw what was happening, the brother already made a few cuts parallel to the faces of the parallelepiped.\r\nThe cuts passed through the whole parallelepiped. After all the cuts were made, the parallelepiped fell to pieces.\r\nHelp Erno determine the initial position of each piece in the parallelepiped.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe first line describes the original parallelepiped. It contains three space-separated integers, which are distance between\r\nfront and rear faces \u003ci\u003ed\u003c/i\u003e, distance between bottom and top faces \u003ci\u003eh\u003c/i\u003e and distance between left and right faces \u003ci\u003ew\u003c/i\u003e\r\n(1 ≤ \u003ci\u003ed\u003c/i\u003e, \u003ci\u003eh\u003c/i\u003e, \u003ci\u003ew\u003c/i\u003e ≤ 1\u0026nbsp;000). Then follows a string of six characters denoting colors of the faces.\r\nThe colors are denoted by symbols “R”, “O”, “Y”, “G”, “B”; and “V”. The front bottom left vertex has coordinates (0, 0, 0)\r\nand the rear top right vertex has coordinates (\u003ci\u003ed\u003c/i\u003e, \u003ci\u003eh\u003c/i\u003e, \u003ci\u003ew\u003c/i\u003e). The colors of the faces are described in the order: front,\r\nrear, bottom, top, left, right. The second line contains a number of pieces \u003ci\u003en\u003c/i\u003e (1 ≤ \u003ci\u003en\u003c/i\u003e ≤ 1\u0026nbsp;000). The following \u003ci\u003en\u003c/i\u003e\r\nlines describe the pieces in the same format as the original parallelepiped. If a face of a piece was not a part of a face of the original\r\nparallelepiped, its color is denoted by “.”.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eOutput the position of each piece in the original parallelepiped. For each piece, output a symbol denoting a face which should become the front\r\nface, followed by a symbol denoting a face which should become the bottom face, followed by coordinates of the front bottom left vertex\r\nof this piece in the original parallelepiped. Denote the front face by “F”, rear face by “B”, bottom face by “D”, top face by “U”,\r\nleft face by “L”, right face by “R”. The pieces should be described in the order of their appearance in the input.\r\nIf there are several possible answers, output any of them. It is guaranteed that the solution exists.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2 2 2 ROYGBV\r\n2\r\n1 2 2 R.YGBV\r\n2 2 1 YGVBO.\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eF D 0 0 0\r\nR F 1 0 0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}