#include <bits/stdc++.h>
using namespace std;
unsigned long long M = 1000000007;
long long ModExpo(long long a, long long b) {
  long long result = 1;
  while (b != 0) {
    if (b & 1) result = (result * a) % M;
    a = (a * a) % M;
    b >>= 1;
  }
  return result;
}
void solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int i = 0;
  string tmp = "";
  while (s[i] == '0' and i < s.size()) {
    tmp.push_back('0');
    i++;
  }
  i = s.size() - 1;
  while (i >= 0 and s[i] == '1') {
    tmp.push_back('1');
    i--;
  }
  if (tmp == s)
    cout << tmp << "\n";
  else {
    int j = 0;
    while (tmp[j] == '0' and j < tmp.size()) {
      cout << '0';
      j++;
    }
    cout << '0';
    j = tmp.size() - 1;
    while (tmp[j] == '1' and j >= 0) {
      cout << '1';
      j--;
    }
    cout << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
