Orient the Rubik's Cube Introduction:

I collect twisty puzzles, so I'm quite the fan of rubiks-cube-challenges (even though most are fairly difficult). So, let's try a fairly easy rubiks-cube-challenge for a change.

When an NxNxN Cube gets scrambled during a WCA (World Cubing Association) competition, the cube is always held in the same way before executing the scramble-algorithm:


  Article 4: Scrambling
  
  
  4d) Scrambling orientation:  
  
  
  4d1) NxNxN puzzles and Megaminx are scrambled starting with the white face (if not possible, then the lightest face) on top and the green face (if not possible, then the darkest adjacent face) on the front.
  
  


"NxNxN puzzles are scrambled starting with the white face on top and the green face on the front."

Challenge:

For the sake of this challenge we only have to look at the centers, so we'll use a 1x1x1 instead of a 3x3x3. Given a valid 1x1x1 Cube in any orientation, output which rotations of x/x', y/y', and/or z/z' are required to have green at the front and white at the top.

Input:

The input will be a 1x1x1 Cube layout in the following format (where F is the front, and U is the top):

 U
LFRB
 D


For example:

 Y
BRGO
 W


Output:

The output will be the least amount of rotations of x/x', y/y', and/or z/z' required to have the white center at the top and green center at the front.

         x                      y                      z




         x'                     y'                     z'




We basically always want to end up in this orientation:

 W
OGRB
 Y


The example given above would therefore result in either of these outputs: x2y/xxy/x'x'y.

NOTE: In the still image of the gifs above, White is the Upper face and Red is the Front face. So the still image of the gif is:

 W
GRBO
 Y


Challenge rules:


You are allowed to take the input in any reasonable format.


You could use other characters or numbers (i.e. 0-5/1-6) instead of WYROGB
You can take the input as single String, as new-line delimiter single String, as String-array, character-array or -matrix, integer-array or -matrix, etc. Your call. (For example, WOGRBY is a valid input in the format ULFRBD.)
Please specify what input-format you've used!

The output must use xyz, but instead of x' you are also allowed to use x3 or X, or instead of x2 you can also use xx (NOTE: You are NOT allowed to use xxx instead of x'/x3/X).


Always output the least amount of rotations. So although x'x'y'y'y' instead of x2y results in the same orientation of the Cube in the end, it's not a valid output because there is a better alternative. Same applies to 
x2y2, because xy'z is one move shorter (x2/xx counts as two moves).
As thumb rule: every possible input results in 0-2 x, 0-2 y and/or 0-2 z rotations, and you'll never need more than three rotations in total (i.e. x2z2 → y2)

You can assume all inputs are valid 1x1x1 Cubes.
If the input is already in the correct position (green front, white top), output nothing (or something indicating nothing, like null, false, 0, an error, etc.)


General rules:


This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
Default Loopholes are forbidden.
If possible, please add a link with a test for your code.
Also, please add an explanation if necessary.


Test cases:

Input:   Output (multiple valid answers are possible for some):

 Y
BRGO     x2y   y'x2   z2y'   yz2   zy'x   zxz   xzx   xyz
 W

 W
OGRB     nothing
 Y

 G
RWOY     y2x'   z2x   yzy   xy2   x'z2   yx'z   zxy   zyz
 B

 W
RBOG     y2
 Y

 R
BWGY     yz   zx   xy
 O

 G
WOYR     x'z   zy   yx'
 B
JavaScript (ES6), 95 bytes

n=&gt;'y2+X+Zyx+ZX+z+ZY+z2+x+Y+zx+zy+Zy2+z2X+x2+zX+y+zY+Z+z2x++Zx+z2Y+Zx2+Zy'.split`+`[n%10955%24]


This works similarly to @Arnauld's answer (credits to him for the idea), but inputs as a base-10 integer (with 123456 instead of WYROGB), which skips the base decoding.

Hash function

Input  | mod 10955 | mod 24 | Output
-------+-----------+--------+-------
136452 |      4992 |      0 | "y2"
145362 |      2947 |     19 | ""
153642 |       272 |      8 | "Y"
164532 |       207 |     15 | "y"
235461 |      5406 |      6 | "z2"
246351 |      5341 |     13 | "x2"
254631 |      2666 |      2 | "Zyx"
263541 |       621 |     21 | "z2Y"
315264 |      8524 |      4 | "z"
326154 |      8459 |     11 | "Zy2"
352614 |      2054 |     14 | "zX"
361524 |         9 |      9 | "zx"
416253 |     10918 |     22 | "Zx2"
425163 |      8873 |     17 | "Z"
451623 |      2468 |     20 | "Zx"
462513 |      2403 |      3 | "ZX"
514236 |     10306 |     10 | "zy"
523146 |      8261 |      5 | "ZY"
531426 |      5586 |     18 | "z2x"
542316 |      5521 |      1 | "X"
613245 |     10720 |     16 | "zY"
624135 |     10655 |     23 | "Zy"
632415 |      7980 |     12 | "z2X"
641325 |      5935 |      7 | "x"


Test Cases



f=n=&gt;'y2+X+Zyx+ZX+z+ZY+z2+x+Y+zx+zy+Zy2+z2X+x2+zX+y+zY+Z+z2x++Zx+z2Y+Zx2+Zy'.split`+`[n%10955%24]
console.log(f(263541))
console.log(f(145362))
console.log(f(531426))
console.log(f(136452))
console.log(f(361524))
console.log(f(514236))