#include <bits/stdc++.h>
using namespace std;
int t, n, A[100005];
char s[100005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> s[i];
      A[i] = A[i - 1];
      if (s[i] != s[i - 1]) A[i] += 1;
    }
    if ((s[1] == '0') && (A[n] == 2) || (A[n] == 1)) {
      for (int i = 1; i <= n; i++) cout << s[i];
      cout << "\n";
      continue;
    }
    if (s[1] == '0')
      for (int i = 1; i <= n; i++)
        if (A[i] == 1) cout << s[i];
    cout << "0";
    if (s[n] == '1')
      for (int i = 1; i <= n; i++)
        if (A[i] == A[n]) cout << s[i];
    cout << "\n";
  }
  return 0;
}
