#include <bits/stdc++.h>
using namespace std;
long long n;
string s;
void solv() {
  cin >> n >> s;
  long long l = 0, r = n - 1, a = 0, b = 0;
  while (l < n and s[l++] == '0') a++;
  while (r >= 0 and s[r--] == '1') b++;
  bool ok = (a + b == n);
  while (a--) cout << 0;
  if (!ok) cout << 0;
  while (b--) cout << 1;
  cout << '\n';
}
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  long long t;
  cin >> t;
  while (t--) solv();
}
