#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int main() {
  cin >> n >> s;
  if (n == 1) {
    cout << s;
    return 0;
  }
  sort(s.begin(), s.end());
  reverse(s.begin(), s.end());
  s += '0';
  for (int i = 0;; i++)
    if (s[i] == '0') {
      for (int j = i - 1; j < n; j++) cout << s[j];
      return 0;
    }
  return 0;
}
