#include <bits/stdc++.h>
using namespace std;
#pragma warning(disable : 4996)
void solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int i = 0, j = n - 1;
  string nl = "", on = "";
  while (i < n && s[i++] == '0') nl += '0';
  i--;
  while (j >= 0 && s[j--] == '1') on += "1";
  j++;
  if (j > i)
    cout << nl << 0 << on;
  else
    cout << nl << on;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
