#include <bits/stdc++.h>
using namespace std;
unsigned long long pow_of_two[10000];
int create() {
  unsigned long long i = 0;
  unsigned long long num = 1;
  while (num <= INT_MAX and num >= 0) {
    num = pow(2, i);
    pow_of_two[i] = num;
    i++;
  }
}
int main() {
  int n;
  cin >> n;
  string str;
  cin >> str;
  int len = str.length();
  int swapi = 0;
  for (int i = len - 1; i >= 0; i--) {
    if (str[i] == '1') {
      for (int j = i - 1; j >= 0; j--) {
        if (str[j] == '1') {
          int left = j;
          int right = i;
          while (left + 1 < right) {
            swap(str[right], str[right - 1]);
            right--;
            swapi++;
          }
          if (str[right] == '1' && str[right - 1] == '1') {
            str[right] = '4';
          }
          break;
        }
      }
    }
  }
  for (int i = 0; i < str.length(); i++) {
    if (str[i] != '4') cout << str[i];
  }
  cout << endl;
}
