# A(0),B(1),C(2),D(3),E(4) ... outer
# H(0),G(1),F(2),J(3),I(4) ... not outer
# white:1, red:0
def p2i(o,n)
o>0 ? n : 5+(2-n)%5
end
while gets
f=[1]*5+[0]*5
$_.chomp.bytes do |c|
o,n=c<70 ? [1,c-65] : [0,(72-c)%5]
rev=f[p2i(o,n)]^=1
[1,-1].each do |s|
t=[[[0,1],[1,4]],[[0,3],[0,4],[1,2]]][o].map{|e|p2i(e[0],(n+e[1]*s)%5)}
j=t.map{|e|f[e]}.find_index(rev)
t[0..j-1].each{|e|f[e]=rev} if j&&j>0
end
end
puts f.map{|e|"RW"[e]}*""
end
IyBBKDApLEIoMSksQygyKSxEKDMpLEUoNCkgLi4uIG91dGVyCiMgSCgwKSxHKDEpLEYoMiksSigzKSxJKDQpIC4uLiBub3Qgb3V0ZXIKIyB3aGl0ZToxLCByZWQ6MApkZWYgcDJpKG8sbikKICBvPjAgPyBuIDogNSsoMi1uKSU1CmVuZAp3aGlsZSBnZXRzCiAgZj1bMV0qNStbMF0qNQogICRfLmNob21wLmJ5dGVzIGRvIHxjfAogICAgbyxuPWM8NzAgPyBbMSxjLTY1XSA6IFswLCg3Mi1jKSU1XQogICAgcmV2PWZbcDJpKG8sbildXj0xCiAgICBbMSwtMV0uZWFjaCBkbyB8c3wKICAgICAgdD1bW1swLDFdLFsxLDRdXSxbWzAsM10sWzAsNF0sWzEsMl1dXVtvXS5tYXB7fGV8cDJpKGVbMF0sKG4rZVsxXSpzKSU1KX0KICAgICAgaj10Lm1hcHt8ZXxmW2VdfS5maW5kX2luZGV4KHJldikKICAgICAgdFswLi5qLTFdLmVhY2h7fGV8ZltlXT1yZXZ9IGlmIGomJmo+MAogICAgZW5kCiAgZW5kCiAgcHV0cyBmLm1hcHt8ZXwiUlciW2VdfSoiIgplbmQ=
QQpGCkoKQUEKSUMKRkMKQUUKR0oKQ0NCCkJFRgpKR0QKSUhDQwpBSURECklKRkEKQUJDREUKSUNFQkEKREFISEQKR0pJSkMKRkd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