#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long cnt0 = 0;
  while (cnt0 < n && s[cnt0] != '1') cnt0++;
  bool ok = false;
  for (long long i = cnt0; i <= n; i++) {
    if (s[i] == '0') ok = true;
  }
  long long cnt1 = 0;
  while (n - 1 - cnt1 >= 0 && s[n - 1 - cnt1] != '0') cnt1++;
  while (cnt0--) cout << "0";
  if (ok) cout << "0";
  while (cnt1--) cout << "1";
  cout << "\n";
}
signed main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long T = 1;
  cin >> T;
  while (T--) solve();
  return 0;
}
