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