#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  for (int q = 0; q < T; q++) {
    int n;
    cin >> n;
    string str;
    cin >> str;
    int s1 = -1;
    int e0 = -1;
    for (int i = 0; i < n; i++) {
      if (str[i] == '1' && s1 == -1) {
        s1 = i;
      }
      if (str[i] == '0') {
        e0 = i;
      }
    }
    if (s1 == -1 || e0 == -1) {
      cout << str << endl;
    } else {
      if (s1 > e0) {
        cout << str << endl;
      } else {
        string out;
        for (int i = 0; i < s1; i++) {
          out += str[i];
        }
        out += '0';
        for (int i = e0 + 1; i < n; i++) {
          out += str[i];
        }
        cout << out << endl;
      }
    }
  }
}
