#include <bits/stdc++.h>
using namespace std;
const int M = (int)(1e9 + 7);
int64_t N;
int main() {
  int t;
  cin >> t;
  while (t--) {
    cin >> N;
    string S;
    cin >> S;
    string look_for = "10";
    bool find = false;
    for (int i = 0; i + 1 < S.length(); ++i)
      if (S[i] == '1' && S[i + 1] == '0') find = true;
    if (!find) {
      cout << S << "\n";
      continue;
    }
    int64_t leading_zeroes = 0;
    int64_t trailing_ones = 0;
    int i = 0;
    while (i < N && S[i] == '0') leading_zeroes++, ++i;
    int j = N - 1;
    while (j >= 0 && S[j] == '1') trailing_ones++, --j;
    string ans;
    ans = string(leading_zeroes + 1, '0');
    ans += string(trailing_ones, '1');
    cout << ans << "\n";
  }
}
