#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    string s1;
    cin >> s1;
    int start1 = -1, last0 = -1;
    for (int i = 0; i < s1.length(); i++) {
      if (s1[i] == '1' && start1 == -1) {
        start1 = i;
      }
      if (s1[i] == '0') {
        last0 = i;
      }
    }
    if (start1 == -1) {
      cout << s1 << endl;
      continue;
    }
    if (last0 == -1) {
      cout << s1 << endl;
      continue;
    }
    for (int i = 0; i < start1; i++) {
      cout << '0';
    }
    int next;
    if (last0 > start1) {
      cout << '0';
      next = last0 + 1;
    } else {
      cout << '1';
      next = start1 + 1;
    }
    for (; next < s1.length(); next++) {
      cout << s1[next];
    }
    cout << endl;
  }
  return 0;
}
