#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = 2 * acos(0.0);
const long long MX = 2e5 + 7;
long long a[MX], b[MX];
vector<long long> v[MX];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  ;
  long long t;
  cin >> t;
  while (t--) {
    ll n;
    cin >> n;
    string s, m, z;
    cin >> s;
    ll p = n + 1, q = -2;
    ll count = 0;
    for (ll i = 0; i < n; i++) {
      if (s[i] == '0') {
        m.push_back(s[i]);
      } else {
        p = i;
        break;
      }
    }
    for (ll i = n - 1; i >= p; i--) {
      if (s[i] == '1') {
        z.push_back(s[i]);
      } else {
        q = i;
        break;
      }
    }
    for (ll i = p; i <= q; i++) {
      if (s[i] == '0') {
        m.push_back(s[i]);
        break;
      }
    }
    cout << m + z << endl;
  }
  return 0;
}
