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