#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, i, n0 = 0, n1 = 0;
    cin >> n;
    string s;
    cin >> s;
    for (i = 0; i < n; ++i) {
      if (s[i] == '0') {
        ++n0;
      } else
        break;
    }
    for (i = n - 1; i >= 0; --i) {
      if (s[i] == '1') {
        ++n1;
      } else
        break;
    }
    if (n0 + n1 == n)
      cout << s << endl;
    else {
      for (i = 0; i <= n0; ++i) cout << "0";
      for (i = 0; i < n1; ++i) cout << "1";
      cout << endl;
    }
  }
  return 0;
}
