#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int a = 0, b = 0, c = 0;
  for (int i = 0; i < n; i++)
    if (s[i] == '0')
      a++;
    else if (s[i] == '1')
      b++;
    else
      c++;
  int no = 0;
  if (a > (n / 3)) no += (a - (n / 3));
  if (b > (n / 3)) no += (b - (n / 3));
  if (c > (n / 3)) no += (c - (n / 3));
  map<int, bool> m;
  if (a < (n / 3)) {
    int bk = (b > (n / 3) ? b - (n / 3) : 0);
    int ck = (c > (n / 3) ? c - (n / 3) : 0);
    for (int i = 0; i < n; i++)
      if (s[i] == '1' && bk > 0) {
        if (a == (n / 3)) break;
        s[i] = '0';
        bk--;
        a++;
      }
    for (int i = 0; i < n; i++)
      if (s[i] == '2' && ck > 0) {
        if (a == (n / 3)) break;
        s[i] = '0';
        ck--;
        a++;
      }
  }
  if (c < (n / 3)) {
    int ak = (a > (n / 3) ? a - (n / 3) : 0);
    int bk = (b > (n / 3) ? b - (n / 3) : 0);
    for (int i = n - 1; i >= 0; i--)
      if (s[i] == '0' && ak > 0) {
        if (c == (n / 3)) break;
        s[i] = '2';
        ak--;
        c++;
      }
    for (int i = n - 1; i >= 0; i--)
      if (s[i] == '1' && bk > 0) {
        if (c == n / 3) break;
        s[i] = '2';
        bk--;
        c++;
      }
  }
  if (b < (n / 3)) {
    int ak = (a > (n / 3) ? a - (n / 3) : 0);
    int ck = (c > (n / 3) ? c - (n / 3) : 0);
    for (int i = n; i >= 0; i--)
      if (s[i] == '0' && ak > 0) {
        if (b == (n / 3)) break;
        s[i] = '1';
        ak--;
        b++;
      }
    for (int i = 0; i < n; i++)
      if (s[i] == '2' && ck > 0) {
        if (b == (n / 3)) break;
        s[i] = '1';
        ck--;
        b++;
      }
  }
  cout << s << '\n';
  return 0;
}
