#include <bits/stdc++.h>
using namespace std;
string s, t;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int u;
  long long n;
  cin >> u;
  while (u--) {
    cin >> n;
    cin >> s;
    long long st = -1, en = -1;
    t = "";
    for (int i = 0; i < n; i++) {
      if (s[i] == '1') {
        st = i;
        break;
      }
    }
    for (int i = n - 1; i >= 0; i--) {
      if (s[i] == '0') {
        en = i;
        break;
      }
    }
    if (st == -1 || en == -1 || st >= en) {
      cout << s << endl;
      continue;
    }
    for (int i = 0; i < st; i++) t += s[i];
    if (st < en) t += '0';
    for (int i = en + 1; i < n; i++) t += s[i];
    cout << t << endl;
  }
}
