#include <bits/stdc++.h>
int main() {
  int test;
  scanf("%d", &test);
  while (test--) {
    int panjang;
    scanf("%d", &panjang);
    char str[panjang];
    scanf("%s", &str);
    int temp = 0, temp1 = 0;
    for (int z = 0; z < panjang; z++) {
      if (str[z] == '0') temp++;
      if (str[z] == '1') break;
    }
    for (int z = panjang - 1; z >= 0; z--) {
      if (str[z] == '0') break;
      if (str[z] == '1') temp1++;
    }
    if (temp + temp1 < panjang) temp++;
    for (int z = 1; z <= temp; z++) printf("0");
    for (int z = 1; z <= temp1; z++) printf("1");
    printf("\n");
  }
}
