#include <bits/stdc++.h>
using namespace std;
int main() {
  long int t;
  cin >> t;
  while (t--) {
    long int n;
    cin >> n;
    string s;
    for (int i = 0; i < n; i++) {
      char c;
      cin >> c;
      s = s + c;
    }
    int flag = 0;
    for (int i = 0; i < n - 1; i++) {
      if (s[i] > s[i + 1]) {
        flag = 1;
      }
    }
    if (flag == 0) {
      cout << s << endl;
      continue;
    }
    int f = 0;
    for (int i = 0; i < n - 1; i++) {
      if (s[i] < s[i + 1]) f = 1;
    }
    if (f == 0) {
      cout << "0" << endl;
      continue;
    }
    string y = "";
    for (int i = 0; i < n; i++) {
      if (s[i] == '0')
        y = y + s[i];
      else {
        break;
      }
    }
    y = y + '0';
    for (int i = n - 1; i >= 0; i--) {
      if (s[i] == '1')
        y = y + s[i];
      else
        break;
    }
    cout << y << endl;
  }
}
