#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  map<int, int> m;
  set<int> set;
  cin >> n;
  int ar[n + 10];
  string s;
  cin >> s;
  int a0 = 0, a1 = 0, a2 = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '0')
      a0++;
    else if (s[i] == '1')
      a1++;
    else
      a2++;
  }
  int per = n / 3;
  if (a0 < per) {
    int need = per - a0;
    int n1 = 0, n2 = 0;
    if (a1 > per) {
      n1 = min(need, a1 - per);
      a1 = a1 - n1;
      need = need - n1;
    }
    if (a2 > per) {
      n2 = min(need, a2 - per);
      a2 = a2 - n2;
      need = need - n2;
    }
    for (int i = 0; i < s.size(); i++) {
      if ((s[i] == '1') && (n1 > 0)) {
        s[i] = '0';
        n1--;
      }
      if ((s[i] == '2') && (n2 > 0)) {
        s[i] = '0';
        n2--;
      }
    }
  }
  if (a2 < per) {
    int need = per - a2;
    int n0 = 0, n1 = 0;
    if (a1 > per) {
      n1 = min(need, a1 - per);
      a1 = a1 - n1;
      need = need - n1;
    }
    if (a0 > per) {
      n0 = min(need, a0 - per);
      a0 = a0 - n0;
      need = need - n0;
    }
    for (int i = s.size() - 1; i >= 0; i--) {
      if ((s[i] == '1') && (n1 > 0)) {
        s[i] = '2';
        n1--;
      }
      if ((s[i] == '0') && (n0 > 0)) {
        s[i] = '2';
        n0--;
      }
    }
  }
  if (a1 < per) {
    int need = per - a1;
    int n0 = 0, n2 = 0;
    if (a0 > per) {
      n0 = min(need, a0 - per);
      a0 = a0 - n0;
      need = need - n0;
    }
    if (a2 > per) {
      n2 = min(need, a2 - per);
      a2 = a2 - n2;
      need = need - n2;
    }
    for (int i = s.size() - 1; i >= 0; i--) {
      if ((s[i] == '0') && (n0 > 0)) {
        s[i] = '1';
        n0--;
      }
    }
    for (int i = 0; i < s.size(); i++) {
      if ((s[i] == '2') && (n2 > 0)) {
        s[i] = '1';
        n2--;
      }
    }
  }
  cout << s << endl;
  return 0;
}
