#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<map>
#include<vector>
#include<stack>
#define int long long
#define endl '\n'
using namespace std;
typedef pair<int,int> PII;
const int N=200200;
int n;
int a[N],b[N];
int x,y;
string s;
int o=0,p=0;
map<char,int> m;
void solve(){
cin>>x>>y>>s;
if(x==0&&y==0){
cout<<"Impossible"<<endl;
return;
}
for(int i=0;i<s.size();i++){
if(s[i]=='L') o--;
if(s[i]=='R') o++;
if(s[i]=='U') p++;
if(s[i]=='D') p--;
m[s[i]]++;
}
if(o==x&&p==y){
cout<<"Impossible"<<endl;
return;
}
if(abs(o)<abs(x)){
if(x>=0){
while(m[L]){
cout<<"L";
}
while(m[R]){
cout<<"R";
}
}
else{
while(m[L]){
cout<<"L";
}
while(m[R]){
cout<<"R";
}
}
}
}
signed main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int T=1;
cin>>T;
while(T--){
solve();
}
return 0;
}