#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
int32_t main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    string s;
    cin >> s;
    string ans;
    long long k = -1;
    for (long long i = 0; i < s.length(); i++) {
      if (s[i] == '1') {
        k = i;
        break;
      }
      ans += s[i];
    }
    long long lastzero = -1;
    if (k == -1) {
      cout << s << "\n";
      continue;
    }
    for (long long j = s.length() - 1; j >= 0; j--) {
      if (s[j] == '0') {
        lastzero = j;
        break;
      }
    }
    if (lastzero != -1) {
      if (k == lastzero + 1) lastzero++;
      for (long long j = lastzero; j < s.length(); j++) {
        ans += s[j];
      }
      cout << ans << "\n";
    } else
      cout << s << "\n";
  }
}
