#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    string s;
    cin >> s;
    string ans;
    long long i = 0;
    long long pos = -1;
    while (i < n && s[i] == '0') {
      ans += '0';
      i++;
    }
    pos = i - 1;
    i = n - 1;
    string tans;
    while (i >= 0 && s[i] == '1') {
      tans += s[i];
      i--;
    }
    if (pos != i) {
      ans += '0';
      ans += tans;
    } else {
      ans += tans;
    }
    cout << ans << endl;
  }
}
