#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, p = -1, q = -1, u = 0, qq;
    cin >> n;
    string s;
    cin >> s;
    for (int i = 0; i < n; i++) {
      if (s[i] == '0') p = i;
      if (s[i] == '1' && u == 0) {
        qq = i;
        u++;
      }
      if (s[i] == '1') q = i;
    }
    if (p == -1)
      cout << s << "\n";
    else if (q == -1)
      cout << s << "\n";
    else {
      for (int i = 0; i < qq; i++) cout << "0";
      if (qq != p + 1) cout << "0";
      for (int i = p + 1; i < n; i++) cout << "1";
      cout << "\n";
    }
  }
}
