#include <bits/stdc++.h>
using namespace std;
long long tc, p, k;
vector<long long> v;
deque<char> ms;
string str;
int main() {
  cin >> tc;
  while (tc--) {
    int n;
    cin >> n >> str;
    int start = -1, finish = 0;
    for (int i = 0; i < n; i++) {
      if (str[i] == '1' && start == -1) {
        start = i;
        finish = i;
      }
      if (str[i] == '0' && start != -1) finish = i;
    }
    for (int i = 0; i < start; i++) cout << str[i];
    for (int i = finish; i < n; i++) cout << str[i];
    cout << '\n';
  }
}
