#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  getchar();
  string s, s1;
  cin >> s;
  bool x = true;
  for (int i = 1; i < n; i++) {
    if (s[i] < s[i - 1]) x = false;
  }
  if (x) {
    cout << s << endl;
    return;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '1') break;
    s1.push_back('0');
  }
  s1.push_back('0');
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '0') break;
    s1.push_back('1');
  }
  cout << s1 << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
