#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long int maximum(long long int a, long long int b) {
  if (a > b)
    return a;
  else
    return b;
}
long long int power(long long int a, long long int n) {
  long long int result = 1;
  while (n > 0) {
    if (n & 1) {
      result = result * a;
    }
    a = a * a;
    n = n >> 1;
  }
  return result;
}
int main() {
  fast();
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    string ans;
    int k = -1;
    for (int i = 0; i < s.length(); i++) {
      if (s[i] == '1') {
        k = i;
        break;
      }
      ans += s[i];
    }
    int lastzero = -1;
    if (k == -1) {
      cout << s << endl;
      continue;
    }
    for (int j = s.length() - 1; j >= 0; j--) {
      if (s[j] == '0') {
        lastzero = j;
        break;
      }
    }
    if (lastzero != -1) {
      if (k == lastzero + 1) lastzero++;
      for (int j = lastzero; j < s.length(); j++) {
        ans += s[j];
      }
      cout << ans << endl;
    } else
      cout << s << endl;
  }
}
