#include <bits/stdc++.h>
const int inf = 0x3f3f3f3f;
const double pi = 4.0 * atan(1.0);
using namespace std;
const int maxn = 3e5 + 10;
int a[3];
int ans[maxn];
char ch[maxn];
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", ch);
  int i, j;
  memset(a, 0, sizeof(a));
  for (i = 0; i < n; i++) a[ch[i] - '0']++;
  for (i = 0; i < n; i++) ans[i] = ch[i] - '0';
  int num0 = a[0] - n / 3;
  int num1 = a[1] - n / 3;
  int num2 = a[2] - n / 3;
  for (i = 0; i < n; i++) {
    if (ans[i] == 2) {
      if (num2 > 0 && num0 < 0) {
        ans[i] = 0;
        num0++;
        num2--;
      } else if (num2 > 0 && num1 < 0) {
        ans[i] = 1;
        num1++;
        num2--;
      }
    } else if (ans[i] == 1) {
      if (num1 > 0 && num0 < 0) {
        ans[i] = 0;
        num0++;
        num1--;
      }
    }
  }
  for (i = n - 1; i >= 0; i--) {
    if (ans[i] == 1) {
      if (num2 < 0 && num1 > 0) {
        ans[i] = 2;
        num2++;
        num1++;
      }
    } else if (ans[i] == 0) {
      if (num2 < 0 && num0 > 0) {
        ans[i] = 2;
        num2++;
        num0--;
      } else if (num1 < 0 && num0 > 0) {
        ans[i] = 1;
        num1++;
        num0--;
      }
    }
  }
  for (i = 0; i < n; i++) printf("%d", ans[i]);
  printf("\n");
  return 0;
}
