#include <bits/stdc++.h>
using namespace std;
int _, n;
string s;
int main() {
  scanf("%d", &_);
  while (_--) {
    scanf("%d", &n);
    cin >> s;
    if (n == 1)
      cout << s << endl;
    else {
      string t = "";
      for (int i = 0; i < n; i++) {
        if (s[i] == '1')
          break;
        else
          t += '0';
      }
      string k = "";
      for (int i = n - 1; i >= 0; i--) {
        if (s[i] == '0')
          break;
        else
          k += '1';
      }
      if (k.length() + t.length() == 0)
        puts("0");
      else if (k.length() + t.length() == n || k.length() == n ||
               t.length() == n)
        cout << s << endl;
      else
        cout << t + "0" + k << endl;
    }
  }
}
