#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    string s;
    cin >> n >> s;
    int z = -1, o = -1;
    for (int i = 0; i < n; ++i) {
      if (s[i] == '1' && o == -1) o = i;
      if (s[i] == '0') z = i;
    }
    if (min(z, o) != -1 && o < z)
      cout << s.substr(0, o) + "0" + s.substr(z + 1, n - z - 1) << "\n";
    else
      cout << s << "\n";
  }
  return 0;
}
