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