#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int mod = 1e9 + 7;
int t, n;
string s;
int main() {
  ios::sync_with_stdio(false);
  cin >> t;
  while (t--) {
    cin >> n >> s;
    int l = -1, r = -1;
    for (int i = 0; i < n; i++) {
      if (l == -1 && s[i] == '1') {
        l = i;
      }
      if (s[i] == '0') r = i;
    }
    if (l == -1 || r == -1 || l > r) {
      cout << s << "\n";
    } else {
      for (int i = 0; i < l; i++) {
        cout << s[i];
      }
      cout << "0";
      for (int i = r + 1; i < n; i++) {
        cout << s[i];
      }
      cout << "\n";
    }
  }
  return 0;
}
