#include <bits/stdc++.h>   using namespace std;   int a[110], b[110], n;   int main() {     int t;     cin >> t;     while (t--) {       cin >> n;       for (register int i = 1; i <= n; i++) cin >> a[i];       for (register int i = 1; i <= n; i++) cin >> b[i];       sort(a + 1, a + n + 1);       sort(b + 1, b + n + 1);       for (register int i = 1; i <= n; i++) cout << a[i] <<    ;       puts(  );       for (register int i = 1; i <= n; i++) cout << b[i] <<    ;       puts(  );     }     return 0;   }   