#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve(){
int x0,y0;
scanf("%d %d",&x0,&y0);
int x=0,y=0;
int up=0,down=0,left=0,right=0;
string s;
cin>>s;
if(x0==0&&y0==0){
printf("Impossible");
return ;
}
int len=s.length();
for(int i=0;i<len;i++){
if(s[i]=='U'){
up++;
y++;
}else if(s[i]=='D'){
down++;
y--;
}else if(s[i]=='L'){
left++;
x--;
}else{
right++;
x++;
}
}
if(x==x0&&y==y0){
printf("Impossible");
return ;
}else if(x!=x0&&y!=y0){
int i=0;
if(x0!=0){//(m,0)
while(i<min(up,down)){
printf("UD");
i++;
}
int sub=max(up-i,down-i);
if(up>i){
while(sub){
printf("U");
sub--;
}
}else{//down
while(sub){
printf("D");
sub--;
}
}
//(0,yend),yend!=y0
i=0;
while(i<min(left,right)){
printf("LR");
i++;
}
sub=max(left-i,right-i);
if(left>i){
while(sub){
printf("L");
sub--;
}
}else{
while(sub){
printf("R");
sub--;
}
}
}else{//x==0,y!=0(0,n)
i=0;
while(i<min(left,right)){
printf("LR");
i++;
}
int sub=max(left-i,right-i);
if(left>i){
while(sub){
printf("L");sub--;
}
}else{
while(sub){
printf("R");sub--;
}
}
//(xend,0);xend!=x0
i=0;
while(i<min(up,down)){
printf("UD");
i++;
}
sub=max(up-i,down-i);
if(up>i){
while(sub){
printf("U");
sub--;
}
}else{//down
while(sub){
printf("D");
sub--;
}
}
}
}else if(x==x0&&y!=y0){
if(left==0&&right==0&&((y0>0&&y>y0)||(y0<0&&y<y0))){
printf("Impossible");//横向不可调
return ;
}else{
int i=0;
if(y0==0){//x0!=0
while(i<min(up,down)){
printf("UD");
i++;
}
int sub=max(up-i,down-i);
if(up>i){
while(sub){
printf("U");sub--;
}
}else{
while(sub){
printf("D");sub--;
}
}
//(0,m),y0==0
while(left){
printf("L");left--;
}
while(right){
printf("R");right--;
}
}else if(y0>0){
if(x0==0){//先拐弯
//拐弯
if(left>0){//也有可能l=r=0;y<y0
printf("L");left--;
}
i=0;
while(i<min(up,down)){
printf("DU");
i++;
}
int sub=max(up-i,down-i);
if(down>i){
while(sub){
printf("D");sub--;
}
}else{
while(sub){
printf("U");sub--;
}
}
//yend!=y0
i=0;
while(i<min(left,right)){
printf("LR");
i++;
}
sub=max(left-i,right-i);
if(left>i){
while(sub){
printf("L");sub--;
}
}else{
while(sub){
printf("R");sub--;
}
}
}else{
while(i<min(up,down)){
printf("UD");
i++;
}
int sub=max(up-i,down-i);
if(up>i){
while(sub){
printf("U");sub--;
}
}else{
while(sub){
printf("D");sub--;
}
}
while(left){
printf("L");left--;
}
while(right){
printf("R");right--;
}
}
}else{//y0<0
if(x0==0){
if(left>0){//也有可能l=r=0;y>y0
printf("L");left--;
}//拐弯
i=0;
while(i<min(up,down)){
printf("UD");
i++;
}
int sub=max(up-i,down-i);
if(up>i){
while(sub){
printf("U");sub--;
}
}else{
while(sub){
printf("D");sub--;
}
}
//yend!=y0
i=0;
while(i<min(left,right)){
printf("LR");
i++;
}
sub=max(left-i,right-i);
if(left>i){
while(sub){
printf("L");sub--;
}
}else{
while(sub){
printf("R");sub--;
}
}
}else{
while(i<min(up,down)){
printf("UD");
i++;
}
int sub=max(up-i,down-i);
if(up>i){
while(sub){
printf("U");sub--;
}
}else{
while(sub){
printf("D");sub--;
}
}
while(left){
printf("L");left--;
}
while(right){
printf("R");right--;
}
}
}
}
}else{//x!=x0&&y==y0
if(up==0&&down==0((x0>0&&x>x0)||(x0<0&&x<x0))){
printf("Impossible");//纵向不可调
return ;
}
int i=0;
if(x0==0){//y0!=0
while(i<min(left,right)){
printf("LR");
i++;
}
int sub=max(left-i,right-i);
if(left>i){
while(sub){
printf("L");sub--;
}
}else{
while(sub){
printf("R");sub--;
}
}
//(m,0),x0==0
while(up){
printf("U");up--;
}
while(down){
printf("D");down--;
}
}else if(x0>0){
if(y0==0){
//拐弯
if(up>0){//也有可能u=d=0;x<x0
printf("U");up--;
}
i=0;
while(i<min(left,right)){
printf("LR");
i++;
}
int sub=max(left-i,right-i);
if(left>i){
while(sub){
printf("L");sub--;
}
}else{
while(sub){
printf("R");sub--;
}
}
//xend!=x0
i=0;
while(i<min(up,down)){
printf("UD");
i++;
}
sub=max(up-i,down-i);
if(up>i){
while(sub){
printf("U");sub--;
}
}else{
while(sub){
printf("D");sub--;
}
}
}else{
i=0;
while(i<min(left,right)){
printf("LR");
i++;
}
int sub=max(left-i,right-i);
if(left>i){
while(sub){
printf("L");sub--;
}
}else{
while(sub){
printf("R");sub--;
}
}
//xend!=x0
i=0;
while(i<min(up,down)){
printf("UD");
i++;
}
sub=max(up-i,down-i);
if(up>i){
while(sub){
printf("U");sub--;
}
}else{
while(sub){
printf("D");sub--;
}
}
}
}else{//x0<0
if(y0==0){
//拐弯
if(up>0){//也有可能up=down=0;x>x0
printf("U");up--;
}
i=0;
while(i<min(left,right)){
printf("RL");
i++;
}
int sub=max(left-i,right-i);
if(right>i){
while(sub){
printf("R");sub--;
}
}else{
while(sub){
printf("L");sub--;
}
}
//xend!=x0
i=0;
while(i<min(up,down)){
printf("UD");
i++;
}
sub=max(up-i,down-i);
if(up>i){
while(sub){
printf("U");sub--;
}
}else{
while(sub){
printf("D");sub--;//最后这里拐回来
}
}
}else{
i=0;
while(i<min(left,right)){
printf("RL");
i++;
}
int sub=max(left-i,right-i);
if(right>i){
while(sub){
printf("R");sub--;
}
}else{
while(sub){
printf("L");sub--;
}
}
//xend!=x0
i=0;
while(i<min(up,down)){
printf("UD");
i++;
}
sub=max(up-i,down-i);
if(up>i){
while(sub){
printf("U");sub--;
}
}else{
while(sub){
printf("D");sub--;//最后这里拐回来
}
}
}
}
}
}
int main(){
int t=1;
scanf("%d",&t);
while(t--){
solve();
if(t) printf("\n");
}
return 0;
}