#include <bits/stdc++.h>
using namespace std;
long long n, tmp1, tmp2, q;
string s, t;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> q;
  for (int rr = 0; rr < q; rr++) {
    cin >> n >> s;
    tmp1 = 0, t = "";
    while (s[tmp1] == '0' && tmp1 < n) {
      cout << 0;
      tmp1++;
    }
    tmp2 = s.length() - 1;
    while (s[tmp2] == '1' && tmp2 >= 0) {
      t += '1';
      tmp2--;
    }
    if (tmp1 < tmp2) {
      cout << 0;
    }
    cout << t << '\n';
  }
}
