#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string line;
  int n;
  while (scanf("%d", &n) != EOF) {
    cin >> line;
    getchar();
    bool has_zero = false;
    for (int i = line.size() - 1; i >= 0; i--) {
      if (line[i] == '1' && i - 1 >= 0) {
        if (line[i - 1] == '0') {
          swap(line[i], line[i - 1]);
          has_zero = true;
        } else if (line[i - 1] == '1')
          line[i] = '2';
      }
    }
    bool start = false;
    if (has_zero) {
      cout << 1;
      for (int i = 0; i < line.size(); i++) {
        if (i + 1 < line.size() && line[i + 1] == '0') start = true;
        if (start && line[i] != '2') {
          cout << line[i];
        }
      }
    } else {
      for (int i = 0; i < line.size(); i++) {
        if (line[i] != '2') cout << line[i];
      }
    }
    cout << endl;
  }
  return 0;
}
