#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  scanf("%lld", &n);
  string str;
  cin >> str;
  long long int ze = 0, on = 0, to = 0;
  for (long long int i = 0; i < n; i++) {
    if (str[i] == '0')
      ze++;
    else if (str[i] == '1')
      on++;
    else
      to++;
  }
  long long int tot = n / 3;
  long long int rep = 0;
  if (to > tot) {
    long long int cnt = to - tot;
    for (long long int i = 0; i < n && cnt > 0; i++) {
      if (str[i] == '2' && ze < tot) {
        str[i] = '0';
        ze++;
        cnt--;
      } else if (str[i] == '2' && on < tot) {
        str[i] = '1';
        on++;
        cnt--;
      }
    }
  }
  if (on > tot) {
    long long int cnt = on - tot;
    for (long long int i = 0; i < n && cnt > 0; i++) {
      if (str[i] == '1' && ze < tot) {
        str[i] = '0';
        ze++;
        cnt--;
      }
    }
    for (long long int i = n - 1; i >= 0 && cnt > 0; i--) {
      if (str[i] == '1' && to < tot) {
        str[i] = '2';
        to++;
        cnt--;
      }
    }
  }
  if (ze > tot) {
    long long int cnt = ze - tot;
    for (long long int i = n - 1; i >= 0 && cnt > 0; i--) {
      if (str[i] == '0' && to < tot) {
        str[i] = '2';
        to++;
        cnt--;
      } else if (str[i] == '0' && on < tot) {
        str[i] = '1';
        on++;
        cnt--;
      }
    }
  }
  cout << str << "\n";
  return 0;
}
