#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    string s;
    cin >> s;
    int i1 = 0;
    while (i1 < s.length() && s[i1] == '0') {
      i1++;
    }
    int i2 = s.length() - 1;
    while (i2 >= 0 && s[i2] == '1') {
      i2--;
    }
    string ans;
    for (long long int i = 0; i < i1; i++) {
      ans += '0';
    }
    if (i1 < i2) {
      ans += '0';
    }
    for (long long int i = s.length() - 1; i > i2; i--) {
      ans += '1';
    }
    cout << ans << "\n";
  }
}
