#include <bits/stdc++.h>
#pragma GCC optimize(2)
const double PI = acos(-1.0);
const int INF = 0x3f3f3f3f;
const int EXP = 1e-8;
const int N = 1e5 + 5;
const int MOD = 1e9 + 7;
const int MAXN = 3e5 + 5;
const int M = 1e9 + 7;
using namespace std;
int n;
char s[MAXN];
long long a[5];
int main() {
  cin >> n >> s;
  memset(a, 0, sizeof(a));
  for (int i = 0; i < n; ++i) a[s[i] - '0']++;
  n /= 3;
  a[0] -= n, a[1] -= n, a[2] -= n;
  if (a[0] == 0 && a[1] == 0 && a[2] == 0) {
    cout << s << endl;
    return 0;
  }
  long long tmp = a[0] * a[1] * a[2];
  long long cnt1 = 0, cnt2 = 0, p, q, j;
  if (tmp == 0) {
    for (int i = 0; i < 3; ++i) {
      if (a[i] > 0) cnt1 = abs(a[i]), p = i;
      if (a[i] < 0) cnt2 = abs(a[i]), q = i;
    }
    if (p < q)
      for (int i = n * 3 - 1; i >= 0; i--)
        if (cnt1 && s[i] == (p + '0')) s[i] = q + '0', cnt1--;
    if (p > q)
      for (int i = 0; i < 3 * n; ++i)
        if (cnt1 && s[i] == (p + '0')) s[i] = q + '0', cnt1--;
  } else if (tmp > 0) {
    for (int i = 0; i < 3; ++i) {
      if (a[i] > 0)
        j = i;
      else if (a[i] < 0)
        if (!cnt1)
          cnt1 = abs(a[i]), p = i;
        else if (!cnt2)
          cnt2 = abs(a[i]), q = i;
    }
    if (j == 0)
      for (int i = n * 3 - 1; i >= 0; i--)
        if (cnt2 && s[i] == (j + '0'))
          s[i] = q + '0', cnt2--;
        else if (cnt1 && s[i] == (j + '0'))
          s[i] = p + '0', cnt1--;
    if (j == 1) {
      for (int i = 0; i < 3 * n; ++i)
        if (cnt1 && s[i] == (j + '0')) s[i] = p + '0', cnt1--;
      for (int i = n * 3 - 1; i >= 0; i--)
        if (cnt2 && s[i] == (j + '0')) s[i] = q + '0', cnt2--;
    }
    if (j == 2)
      for (int i = 0; i < 3 * n; ++i)
        if (cnt1 && s[i] == (j + '0'))
          s[i] = p + '0', cnt1--;
        else if (cnt2 && s[i] == (j + '0'))
          s[i] = q + '0', cnt2--;
  } else if (tmp < 0) {
    for (int i = 0; i < 3; ++i) {
      if (a[i] < 0)
        j = i;
      else if (a[i] > 0)
        if (!cnt1)
          cnt1 = abs(a[i]), p = i;
        else if (!cnt2)
          cnt2 = abs(a[i]), q = i;
    }
    if (j == 2)
      for (int i = n * 3 - 1; i >= 0; i--)
        if (cnt2 && s[i] == (q + '0'))
          s[i] = j + '0', cnt2--;
        else if (cnt1 && s[i] == (p + '0'))
          s[i] = j + '0', cnt1--;
    if (j == 1) {
      for (int i = 0; i < 3 * n; ++i)
        if (cnt2 && s[i] == (q + '0')) s[i] = j + '0', cnt2--;
      for (int i = n * 3 - 1; i >= 0; i--)
        if (cnt1 && s[i] == (p + '0')) s[i] = j + '0', cnt1--;
    }
    if (j == 0)
      for (int i = 0; i < 3 * n; ++i)
        if (cnt1 && s[i] == (p + '0'))
          s[i] = j + '0', cnt1--;
        else if (cnt2 && s[i] == (q + '0'))
          s[i] = j + '0', cnt2--;
  }
  cout << s << endl;
}
