#include <bits/stdc++.h>
using namespace std;
int n, c[3], a[300007];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    char temp;
    cin >> temp;
    a[i] = (int)temp - 48, ++c[a[i]];
  }
  if (c[0] < n / 3) {
    for (int i = 1; i <= n; ++i)
      if (c[a[i]] > n / 3 && c[0] < n / 3) --c[a[i]], ++c[0], a[i] = 0;
  }
  if (c[2] < n / 3) {
    for (int i = n; i >= 1; --i)
      if (c[a[i]] > n / 3 && c[2] < n / 3) --c[a[i]], ++c[2], a[i] = 2;
  }
  if (c[1] < n / 3) {
    for (int i = 1; i <= n; ++i)
      if (a[i] == 2 && c[a[i]] > n / 3 && c[1] < n / 3)
        --c[a[i]], ++c[1], a[i] = 1;
    for (int i = n; i >= 1; --i)
      if (c[a[i]] > n / 3 && c[1] < n / 3) --c[a[i]], ++c[1], a[i] = 1;
  }
  for (int i = 1; i <= n; ++i) cout << a[i];
  return 0;
}
