#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T sqr(T x) {
  return x * x;
}
const double EPS = 1e-6;
const int INF = 0x3fffffff;
const long long LINF = INF * 1ll * INF;
const double PI = acos(-1.0);
char str[300005];
int cnt[5];
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", str);
  for (int i = 0; i < n; i++) cnt[str[i] - '0']++;
  if (cnt[0] > n / 3) {
    for (int i = n - 1; i >= 0; i--) {
      if (str[i] == '0') {
        if (cnt[2] < n / 3 && cnt[0] > n / 3) {
          cnt[2]++;
          cnt[0]--;
          str[i] = '2';
        } else if (cnt[1] < n / 3 && cnt[0] > n / 3) {
          cnt[1]++;
          cnt[0]--;
          str[i] = '1';
        }
      }
    }
  }
  if (cnt[2] > n / 3) {
    for (int i = 0; i < n; i++) {
      if (str[i] == '2') {
        if (cnt[0] < n / 3 && cnt[2] > n / 3) {
          cnt[0]++;
          cnt[2]--;
          str[i] = '0';
        } else if (cnt[1] < n / 3 && cnt[2] > n / 3) {
          cnt[1]++;
          cnt[2]--;
          str[i] = '1';
        }
      }
    }
  }
  if (cnt[1] > n / 3) {
    for (int i = 0; i < n; i++) {
      if (str[i] == '1') {
        if (cnt[0] < n / 3 && cnt[1] > n / 3) {
          cnt[0]++;
          cnt[1]--;
          str[i] = '0';
        }
      }
    }
    for (int i = n - 1; i >= 0; i--) {
      if (str[i] == '1') {
        if (cnt[2] < n / 3 && cnt[1] > n / 3) {
          cnt[2]++;
          cnt[1]--;
          str[i] = '2';
        }
      }
    }
  }
  printf("%s\n", str);
  return 0;
}
