#include <bits/stdc++.h>
using namespace std;
int nTest;
int n;
string s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> nTest;
  for (int iTest = 1; iTest <= nTest; ++iTest) {
    cin >> n >> s;
    int t = -1;
    string res = "";
    for (int i = 0; i < n; ++i) {
      if (s[i] == '0') {
        t = i;
      }
    }
    if (t == -1) {
      cout << s << "\n";
    } else {
      for (int i = 0; i < t && s[i] == '0'; ++i) {
        res += s[i];
      }
      for (int i = t; i < n; ++i) {
        res += s[i];
      }
      cout << res << "\n";
    }
  }
  return 0;
}
