#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
long long n, th, cnt[3], i;
string s;
int main() {
  cin >> n;
  cin >> s;
  th = n / 3;
  for (i = 0; i < n; i++) {
    cnt[s[i] - '0']++;
  }
  i = 0;
  while (cnt[0] < th && cnt[1] > th && i < n) {
    if (s[i] == '1') {
      cnt[1]--;
      cnt[0]++;
      s[i] = '0';
    }
    i++;
  }
  i = 0;
  while (cnt[0] < th && cnt[2] > th && i < n) {
    if (s[i] == '2') {
      cnt[2]--;
      cnt[0]++;
      s[i] = '0';
    }
    i++;
  }
  i = n - 1;
  while (cnt[2] < th && cnt[0] > th && i > -1) {
    if (s[i] == '0') {
      cnt[0]--;
      cnt[2]++;
      s[i] = '2';
    }
    i--;
  }
  i = n - 1;
  while (cnt[2] < th && cnt[1] > th && i > -1) {
    if (s[i] == '1') {
      cnt[1]--;
      cnt[2]++;
      s[i] = '2';
    }
    i--;
  }
  i = n - 1;
  while (cnt[1] < th && cnt[0] > th && i > -1) {
    if (s[i] == '0') {
      cnt[0]--;
      cnt[1]++;
      s[i] = '1';
    }
    i--;
  }
  i = 0;
  while (cnt[1] < th && cnt[2] > th && i < n) {
    if (s[i] == '2') {
      cnt[2]--;
      cnt[1]++;
      s[i] = '1';
    }
    i++;
  }
  cout << s;
}
