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