#include <bits/stdc++.h>
using namespace std;
int power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  int t = 1;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    bool flag = false;
    for (int i = 0; i < n - 1; i++) {
      if (s[i] - s[i + 1] > 0) flag = true;
    }
    if (!flag) {
      cout << s << endl;
    } else {
      int czero = 1;
      int temp = 0;
      while (s[temp++] == '0') czero++;
      temp = n - 1;
      int cone = 0;
      while (s[temp--] == '1') cone++;
      while (czero--) cout << '0';
      while (cone--) cout << '1';
      cout << endl;
    }
  }
}
