#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int x = n / 3;
  string s;
  cin >> s;
  int n0 = 0, n1 = 0, n2 = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '0') n0++;
    if (s[i] == '1') n1++;
    if (s[i] == '2') n2++;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '2' && n2 > x) {
      if (n0 < x) {
        s[i] = '0';
        n2--;
        n0++;
      } else if (n1 < x) {
        s[i] = '1';
        n1++;
        n2--;
      }
    }
    if (s[i] == '1' && n1 > x) {
      if (n0 < x) {
        s[i] = '0';
        n1--;
        n0++;
      }
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '1' && n1 > x) {
      if (n2 < x) {
        s[i] = '2';
        n2++;
        n1--;
      }
    }
    if (s[i] == '0' && n0 > x) {
      if (n2 < x) {
        s[i] = '2';
        n2++;
        n0--;
      } else if (n1 < x) {
        s[i] = '1';
        n1++;
        n0--;
      }
    }
  }
  cout << s << endl;
}
