#include <bits/stdc++.h>
using namespace std;
const int Max = 2e6 + 10;
const int Mod = 1e9 + 7;
const double PI = 3.141592653589793238463;
void input(long long ara[], long long n) {
  for (long long i = 0; i < n; i++) cin >> ara[i];
}
int main() {
  (ios_base::sync_with_stdio(false), cin.tie(NULL));
  ;
  long long i, j, n, m, p, sum = 0, k, t, a, b, c, d, cnt = 0, q, l, r;
  double bb1, bb2, bb3, bb4, bb5, bb6, bb7, bb8;
  string lm1, lm2, lm3, lm5, lm6;
  float ha;
  long long aaa[50];
  string str;
  bool flag = true;
  cin >> t;
  while (t--) {
    cin >> n;
    cin >> str;
    if (n == 1)
      cout << str << endl;
    else {
      i = 0;
      while (str[i] == '0' && i < n) {
        cout << '0';
        i++;
      }
      bool flag = false;
      while (i < n) {
        while (str[i] == '1' && i < n) i++;
        if (str[i] == '0' && i < n) {
          while (str[i] == '0' && i < n) i++;
          flag = true;
          break;
        }
      }
      if (flag) cout << '0';
      i = n - 1;
      while (i >= 0 && str[i] == '1') {
        cout << '1';
        i--;
      }
      cout << endl;
    }
  }
}
