#include <bits/stdc++.h>
using namespace std;
const long long inf = LLONG_MAX;
const long long mod = 1000000007;
long long gcd(long long a, long long b) {
  if (!a || !b) return a | b;
  unsigned shift = __builtin_ctz(a | b);
  a >>= __builtin_ctz(a);
  do {
    b >>= __builtin_ctz(b);
    if (a > b) swap(a, b);
    b -= a;
  } while (b);
  return a << shift;
}
long long gcd(long long a, long long b, long long& x, long long& y) {
  x = 1, y = 0;
  long long x1 = 0, y1 = 1, a1 = a, b1 = b;
  while (b1) {
    long long q = a1 / b1;
    tie(x, x1) = make_tuple(x1, x - q * x1);
    tie(y, y1) = make_tuple(y1, y - q * y1);
    tie(a1, b1) = make_tuple(b1, a1 - q * b1);
  }
  return a1;
}
long long bits(long long x) {
  long long res = 0;
  while (x) {
    x = (x >> 1);
    res++;
  }
  return res;
}
long long power(long long x, long long y, long long p) {
  if (!y) return 1;
  long long z = power(x, y / 2, p);
  z = (z * z) % p;
  if (y % 2) z = (z * x) % p;
  return z;
}
long long g(long long x) {
  if (x < 10) return x;
  long long p = 1;
  while (x) {
    if (x % 10) p *= (x % 10);
    x /= 10;
  }
  return g(p);
}
void solve() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, l;
    cin >> n;
    string s, x;
    cin >> s;
    long long start = 0, end = n - 1;
    while (start < n && s[start] == '0') start++;
    while (end >= 0 && s[end] == '1') end--;
    for (long long i = (0); i < (n); i++)
      if (s[i] == '0')
        cout << 0;
      else
        break;
    if (start < end) cout << 0;
    for (long long i = (n - 1); i >= (0); --i)
      if (s[i] == '1')
        cout << 1;
      else
        break;
    cout << endl;
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
