#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.141592653589793238L;
void init() {
  cin.tie(0);
  cin.sync_with_stdio(0);
}
int main() {
  init();
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cnt[3] = {0};
  for (int i = 0; i < n; i++) cnt[s[i] - '0']++;
  if (cnt[0] == cnt[1] && cnt[0] == cnt[2]) return cout << s, 0;
  int changes[3];
  for (int i = 0; i < 3; i++) changes[i] = max(0, n / 3 - cnt[i]);
  for (int i = n - 1; i >= 0; i--) {
    int x = s[i] - '0';
    if (x == 2) continue;
    if (cnt[x] > n / 3 && changes[2]) {
      changes[2]--;
      cnt[x]--;
      cnt[2]++;
      s[i] = '2';
    }
  }
  for (int i = 0; i < n; i++) {
    int x = s[i] - '0';
    if (x == 0) continue;
    if (cnt[x] > n / 3 && changes[0]) {
      changes[0]--;
      cnt[x]--;
      cnt[0]++;
      s[i] = '0';
    }
  }
  vector<int> twos, zeros;
  for (int i = 0; i < n; i++)
    if (s[i] == '2')
      twos.push_back(i);
    else if (s[i] == '0')
      zeros.push_back(i);
  int i = 0;
  while (changes[1] && cnt[2] > n / 3) {
    changes[1]--;
    s[twos[i++]] = '1';
    cnt[2]--;
    cnt[1]++;
  }
  i = zeros.size() - 1;
  while (changes[1] && cnt[0] > n / 3) {
    changes[1]--;
    s[zeros[i--]] = '1';
    cnt[0]--;
    cnt[1]++;
  }
  cout << s;
}
