#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    int zero = 0;
    while (zero < n && s[zero] == '0') {
      zero++;
    }
    int one = 0;
    while (n - 1 - one >= 0 && s[n - 1 - one] == '1') {
      one++;
    }
    string ans;
    ans += string(zero, '0');
    if (zero + one != n) ans += '0';
    ans += string(one, '1');
    cout << ans << endl;
  }
}
