#include <bits/stdc++.h>
using namespace std;
const int N = 10001;
int t;
unsigned long long n;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  cin >> t;
  string s;
  while (t--) {
    cin >> n >> s;
    bool c = 1;
    for (int i = 1; i < n; i++)
      if (s[i] < s[i - 1]) c = 0, i = n;
    if (c) {
      cout << s << "\n";
      continue;
    }
    string ans = "";
    for (int i = 0; i < n; i++) {
      if (s[i] == '1') break;
      ans += '0';
    }
    ans += '0';
    for (int i = n - 1; i >= 0; i--) {
      if (s[i] == '0') break;
      ans += '1';
    }
    cout << ans << "\n";
  }
  return 0;
}
