#include <bits/stdc++.h>
using namespace std;
void print_Array(int arr[], int start, int end) {
  for (int i = start; i < end; i++) {
    printf("%d ", arr[i]);
  }
}
void test() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int ones = 0, zeros = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '0') break;
    ones++;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '1') break;
    zeros++;
  }
  bool ele = false;
  if (zeros + ones < n) ele = true;
  string res;
  for (int i = 0; i < zeros; i++) res.push_back('0');
  if (ele) res.push_back('0');
  for (int i = 0; i < ones; i++) res.push_back('1');
  cout << res << endl;
}
int main() {
  int p, q, x, y, s, l, r, m, n;
  int N, K;
  int t;
  scanf("%d", &t);
  while (t--) {
    test();
  }
  return 0;
}
