#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long power(long long x, long long y) {
  if (y == 0) return 1;
  long long temp = power(x, y / 2);
  if (y % 2)
    return temp * temp * x;
  else
    return temp * temp;
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    string s;
    cin >> s;
    string ans = "";
    long long j1 = 0;
    for (long long i = 0; i < n; i++) {
      if (s[i] == '0')
        ans += s[i];
      else
        break;
      j1++;
    }
    long long j2 = 0;
    for (int i = n - 1; i >= 0; i--) {
      if (s[i] == '1')
        ans += s[i];
      else
        break;
      j2++;
    }
    if ((j1 + j2) == n)
      cout << ans << endl;
    else {
      for (long long i = 0; i < j1; i++) cout << ans[i];
      cout << "0";
      for (long long i = j1; i < j1 + j2; i++) cout << ans[i];
      cout << endl;
    }
  }
  return 0;
}
