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