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