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