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