#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000 * 1000 * 1000 + 7;
const long long MOD2 = 998244353;
const long long N = 1000 * 1000 + 5;
const double PI = 3.14159265;
long long search(vector<long long> arr, long long l, long long r, long long x) {
  if (r >= l) {
    long long mid = l + (r - l) / 2;
    if (arr[mid] == x) return mid;
    if (arr[mid] > x) return search(arr, l, mid - 1, x);
    return search(arr, mid + 1, r, x);
  }
  return -1;
}
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long modInverse(long long n, long long p) { return power(n, p - 2, p); }
const int maxn = 3e5 + 5;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    int flag = 0;
    string ans = "";
    int o = 0, z = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == '1')
        break;
      else
        z++;
    }
    for (int i = n - 1; i >= 0; i--) {
      if (s[i] == '0')
        break;
      else
        o++;
    }
    if (o + z == n) {
      cout << s << "\n";
      continue;
    }
    for (int i = 0; i < z + 1; i++) ans += "0";
    for (int i = 0; i < o; i++) {
      ans += "1";
    }
    cout << ans << "\n";
  }
}
