#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    string str;
    int n;
    cin >> n;
    cin.ignore();
    getline(cin, str);
    int l = 0, r = n - 1;
    while (l < n && str[l] == '0') {
      l++;
    }
    while (r >= 0 && str[r] == '1') {
      r--;
    }
    if (l >= r) {
      cout << str << endl;
    } else {
      cout << str.substr(0, l) << "0" << str.substr(r + 1, n) << endl;
    }
  }
  return 0;
}
