#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    string str;
    cin >> str;
    string ans = "";
    long long int index = -1, id;
    for (int i = 0; i < (n); i++) {
      if (str[i] == '1') {
        index = i;
        break;
      }
    }
    if (index == -1) {
      cout << str << endl;
    } else {
      long long int j;
      for (j = n - 1; j >= 0; j--) {
        if (str[j] == '0') {
          id = j;
          break;
        }
      }
      if (index > j) {
        cout << str << endl;
      } else {
        ans = str.substr(0, index) + str.substr(j, n);
        cout << ans << endl;
      }
    }
  }
}
