#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
template <typename Type>
istream &operator>>(istream &in, vector<Type> &vec) {
  long long n = vec.size();
  for (int i = 0; i < n; i++) in >> vec[i];
  return in;
}
template <typename Type>
ostream &operator<<(ostream &out, vector<Type> &vec) {
  for (auto val : vec) out << val << " ";
  out << endl;
  return out;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    string s;
    cin >> s;
    long long n_0 = 0, n_1 = 0, n_x = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] != '0') break;
      n_0++;
    }
    for (int i = n - 1; i >= 0; i--) {
      if (s[i] != '1') break;
      n_1++;
    }
    for (int i = 0; i < n - 1; i++) {
      if (s[i] == '1' && s[i + 1] == '0') n_x++;
    }
    for (int i = 0; i < n_0; i++) cout << '0';
    if (0 < n_x) cout << '0';
    for (int i = 0; i < n_1; i++) cout << '1';
    cout << endl;
  }
}
