#include <bits/stdc++.h>
using namespace std;
long long findmax(long long arr[], long long n) {
  long long maxindex = 0;
  for (long long i = 0; i < n; i++) {
    if (arr[i] > arr[maxindex]) maxindex = i;
  }
  return maxindex;
}
signed main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    string s;
    cin >> s;
    string ans;
    long long i, temp = 1;
    for (i = 1; i < n; i++) {
      if (s[i - 1] > s[i]) {
        temp = 0;
        break;
      }
    }
    if (temp) {
      cout << s << "\n";
      continue;
    }
    for (i = 0; i < n; i++) {
      if (s[i] == '1') break;
      ans.push_back('0');
    }
    ans.push_back('0');
    for (i = n - 1; i >= 0; i--) {
      if (s[i] == '0') break;
      ans.push_back('1');
    }
    cout << ans << "\n";
  }
}
