#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, n;
  string a;
  cin >> t;
  while (t--) {
    long long nz = 0;
    long long no = 0;
    long long nz1 = 0;
    long long no1 = 0;
    bool f = 0;
    cin >> n;
    cin >> a;
    long long cnt = 0;
    for (long long i = 0; i < a.size(); ++i) {
      if (a[i] == '0')
        nz++;
      else
        no++;
    }
    for (long long i = 0; i < n; ++i) {
      if (a[i] == '1' || f) {
        f = 1;
        if (a[i] == '0' && cnt < 1)
          cnt++;
        else if (a[i] == '1' && cnt == 1)
          cnt++;
      } else
        nz1++;
    }
    for (int j = n - 1; j >= 0; --j) {
      if (a[j] == '0')
        break;
      else
        no1++;
    }
    string ans;
    for (long long i = 0; i < nz1; ++i) {
      ans += '0';
    }
    if (cnt == 0) {
      for (long long i = 0; i < no; ++i) {
        ans += '1';
      }
      cout << ans << endl;
    } else if (cnt == 1 || (a[n - 1] == '0' && f)) {
      ans += '0';
      cout << ans << endl;
    } else {
      ans += '0';
      for (long long i = 0; i < no1; ++i) {
        ans += '1';
      }
      cout << ans << endl;
    }
  }
}
