#include <bits/stdc++.h>
using namespace std;
template <class T>
void mini(T& a, T b) {
  a = min(a, b);
}
template <class T>
void maxi(T& a, T b) {
  a = max(a, b);
}
template <class T1, class T2>
ostream& operator<<(ostream& out, pair<T1, T2> a) {
  return out << a.first << " " << a.second;
}
template <class T>
ostream& operator<<(ostream& out, vector<T> a) {
  for (auto& i : a) out << i << " ";
  return out;
}
template <class T>
ostream& operator<<(ostream& out, set<T> a) {
  for (auto& i : a) out << i << " ";
  return out;
}
template <class T1, class T2>
ostream& operator<<(ostream& out, map<T1, T2> a) {
  for (auto& i : a) out << i << " ";
  return out;
}
template <class T>
void out(T a) {
  cout << a << endl;
}
void out() { cout << "OK" << endl; }
void Solve() {
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    int zs = 0;
    int os = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == '0')
        zs++;
      else
        break;
    }
    for (int i = n - 1; i >= 0; i--) {
      if (s[i] == '1')
        os++;
      else
        break;
    }
    s = s.substr(zs, n - zs - os);
    bool ok = 0;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '1') {
        if (i == 0 || s[i - 1] == '0') ok = 1;
      }
    }
    if (ok) zs++;
    string ans;
    for (int i = 0; i < zs; i++) ans += '0';
    for (int i = 0; i < os; i++) ans += '1';
    cout << ans << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  Solve();
  return 0;
}
