#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    int i = 0, j = n - 1;
    while (i < n && s[i] == '0') i++;
    while (j >= 0 && s[j] == '1') j--;
    if (i == j + 1)
      cout << s << "\n";
    else {
      string a = (i > 0) ? s.substr(0, i) : "";
      string b = (j < n - 1) ? s.substr(j + 1, s.length() - j + 1) : "";
      cout << a + "0" + b << "\n";
    }
  }
  return 0;
}
