/* ********************************* Author :clogos Created Time :2016/09/24 20:03:53 File Name :B.cpp ********************************** */ #include #define IOS ios::sync_with_stdio(0);cin.tie(0); #define IN freopen("in", "r", stdin); #define OUT freopen("out", "w", stdout); using namespace std; const int N = 1000 + 10; char str[N], ans[N]; bool ok(int t_two, int t_one, int m, int len) { if((m < 0) || (m > 2 * t_two + t_one) || ((m & 1) && t_one == 0) || (m > len)) return false; else return true; } int main() { int cases; scanf("%d", &cases); while(cases--) { int n, dn, m; scanf("%d%d", &n, &m); m = n - m; dn = n / 2; scanf("%s", str); int t_two = 0, t_one = 0; for(int i = 0; i < dn; ++i) { if(str[i] == str[i+dn]) t_two++; else t_one++; } if(!ok(t_two, t_one, m, n)) { printf("Impossible\n"); continue; } for(int i = 0; i < dn; ++i) { if(str[i] == str[i+dn]) { if(str[i] == 'a') { if(ok(t_two-1, t_one, m-2, n-2*(i+1))) { ans[i] = ans[i+dn] = 'a'; m -= 2; } else ans[i] = ans[i+dn] = 'b'; } else { if(ok(t_two-1, t_one, m, n-2*(i+1))) { ans[i] = ans[i+dn] = 'a'; } else { ans[i] = ans[i+dn] = str[i]; m -= 2; } } t_two--; } else { if(str[i] == 'a' || str[i+dn] == 'a') { if(ok(t_two, t_one-1, m-1, n-2*(i+1))) { ans[i] = ans[i+dn] = 'a'; m -= 1; } else { if(str[i] == 'b' || str[i+dn] == 'b') ans[i] = ans[i+dn] = 'c'; else ans[i] = ans[i+dn] = 'b'; } } else { if(ok(t_two, t_one-1, m, n-2*(i+1))) { ans[i] = ans[i+dn] = 'a'; } else { ans[i] = ans[i+dn] = min(str[i], str[i+dn]); m -= 1; } } t_one--; } } for(int i = 0; i < n; ++i) printf("%c", ans[i]); printf("\n"); } return 0; }