#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, c = 0, t;
  string s;
  cin >> t;
  while (t--) {
    cin >> n;
    cin >> s;
    long long d = 1;
    for (long long i = 0; i < n; i++) {
      if (s[i] < s[i - 1]) d = 0;
    }
    if (d)
      cout << s;
    else {
      string a;
      for (long long i = 0; i < n; i++) {
        if (s[i] == '1') break;
        a.push_back('0');
      }
      a.push_back('0');
      for (long long i = n - 1; i >= 0; i--) {
        if (s[i] == '0') break;
        a.push_back('1');
      }
      cout << a;
    }
    cout << "\n";
  }
}
