#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}
const int INF = 1 << 29;
const int MOD = 1e9 + 7;
const int N = 3e5 + 10;
char s[N];
int cnt[3], a[3][3];
vector<int> A[3];
int main() {
  int n;
  scanf("%d%s", &n, s);
  for (int i = 0; i < n; ++i) {
    int x = s[i] - '0';
    cnt[x]++;
    A[x].push_back(i);
  }
  for (int i = 0; i < 3; ++i) {
    if (cnt[i] <= n / 3) continue;
    a[i][i] = cnt[i];
    for (int j = 0; j < 3; ++j) {
      if (j == i) continue;
      if (cnt[j] < n / 3) {
        a[i][j] = min(n / 3 - cnt[j], cnt[i] - n / 3);
        a[i][i] -= a[i][j];
      }
    }
    int k = 0;
    for (int j = 0; j < 3; ++j) {
      while (a[i][j]--) {
        s[A[i][k++]] = '0' + j;
      }
    }
  }
  puts(s);
  return 0;
}
