#include <bits/stdc++.h>
using namespace std;
const long long int N = 1e6 + 10;
const long long int mod = 1e9 + 7;
const double pi = acos(-1);
void go() {
  long long int n;
  string s;
  cin >> n >> s;
  string ans = "", ans2 = "";
  long long int i = 0;
  while (s[i] == '0' && i < n) {
    ans += '0';
    i++;
  }
  long long int n1 = n - 1;
  while (s[n1] != '0' && n1 >= 0) {
    n1--;
    ans2 += '1';
  }
  if (ans.size() + ans2.size() == n)
    cout << ans << ans2 << '\n';
  else
    cout << ans << "0" << ans2 << "\n";
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int t = 1;
  cin >> t;
  while (t--) {
    go();
  }
  return 0;
}
