#include <bits/stdc++.h>
#define endl '\n'
#define int long long
using namespace std;
const int N = 1e6 + 5;
void solve() {
int x, y;
cin >> x >> y;
string s;
cin >> s;
map<char, int> cnt;
int ex = 0, ey = 0;
for (char c : s) {
cnt[c]++;
}
ey = cnt['U'] - cnt['D'];
ex = cnt['R'] - cnt['L'];
int eex = ex, eey = ey;
// cerr << ex << ' ' << ey << endl;
if (x == 0 && y == 0 || x == ex && y == ey) {
cout << "Impossible" << endl;
return;
}
if ( ex == 0 || ey == 0 ) {
if ( cnt['L'] == 0 && cnt['R'] == 0 ) {
if ( abs(y) <= abs(ey) && y * ey >= 0 ) {
cout << "Impossible" << endl;
return;
}
} else if ( cnt['U'] == 0 && cnt['D'] == 0 ) {
if ( abs(x) <= abs(ex) && x * ex >= 0 ) {
cout << "Impossible" << endl;
return;
}
}
}
random_shuffle(s.begin(), s.end());
while (1) {
if (check(s, x, y)) {
break;
}
random_shuffle(s.begin(), s.end());
}
cout << s << endl;
}
bool check(string path, int x, int y) {
int xx = 0, yy = 0;
for (char c : path) {
if (c == 'U')
yy++;
if (c == 'D')
yy--;
if (c == 'L')
xx--;
if (c == 'R')
xx++;
if (xx == x && yy == y) {
return false;
}
}
return true;
}
signed main() {
ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
int T = 1;
cin >> T;
while (T--) solve();
//check("RRUUUUUUUURLRLRLUDUDUD", 4, 1);
return 0;
}