#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
char S[maxn];
int cnt[3], cur[3], passed[3];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n >> (S + 1);
  int g = n / 3;
  for (int i = 1; i <= n; i++) {
    cnt[S[i] - '0']++;
  }
  for (int i = 0; i <= 2; i++) {
    cur[i] = cnt[i] - g;
  }
  for (int i = 1; i <= n; i++) {
    switch (S[i]) {
      case '2':
        if (cur[2] > 0) {
          if (cur[0] < 0) {
            S[i] = '0';
            cur[0]++;
            cur[2]--;
            passed[0]++;
          } else if (cur[1] < 0) {
            S[i] = '1';
            cur[1]++;
            cur[2]--;
            passed[1]++;
          } else
            passed[2]++;
        }
        break;
      case '1':
        if (cur[1] > 0) {
          if (cur[0] < 0) {
            S[i] = '0';
            cur[0]++;
            cur[1]--;
            passed[0]++;
          } else if (cur[2] < 0 && passed[1] >= g) {
            S[i] = '2';
            cur[2]++;
            cur[1]--;
            passed[2]++;
          } else
            passed[1]++;
        }
        break;
      case '0':
        if (cur[0] > 0) {
          if (cur[1] < 0 && passed[0] >= g) {
            S[i] = '1';
            cur[1]++;
            cur[0]--;
            passed[1]++;
          } else if (cur[2] < 0 && passed[0] >= g) {
            S[i] = '2';
            cur[2]++;
            cur[0]--;
            passed[2]++;
          } else
            passed[0]++;
        }
        break;
    }
  }
  cout << S + 1 << endl;
  return 0;
}
