#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
void test_case() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  if (n == 1)
    cout << s << '\n';
  else {
    int cnt1 = 0, cnt2 = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == '0')
        cnt1++;
      else
        break;
    }
    for (int i = n - 1; i >= 0; i--) {
      if (s[i] == '1')
        cnt2++;
      else
        break;
    }
    if (cnt1 + cnt2 == n)
      cout << s << '\n';
    else {
      cnt1++;
      string ans = {};
      for (int i = 0; i < cnt1; i++) ans += '0';
      for (int i = 0; i < cnt2; i++) ans += '1';
      cout << ans << '\n';
    }
  }
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) test_case();
  return 0;
}
